Skip to content

zbbsdsb/cppcraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cppcraft

A Minecraft-like voxel game built with C++, OpenGL, and GLFW.

Features

  • Voxel World: 16×16×256 chunk-based world system
  • Procedural Terrain Generation: Noise-based terrain generation using fractal brownian motion
  • First-person Camera: WASD movement with mouse look controls
  • Texture Atlas: Single texture atlas for all block types
  • Chunk Loading: Dynamic chunk management
  • Basic Lighting: Simple diffuse lighting
  • Save/Load Functionality: Save and load world data
  • Cross-platform: Built with CMake for easy cross-platform development

Dependencies

  • GLFW 3.3: Window creation and input handling
  • OpenGL: Graphics rendering
  • GLEW: OpenGL extension loading

Building

Prerequisites

  • CMake: Version 3.16 or higher
  • Ninja: Build system
  • vcpkg: Package manager for dependencies
  • MSVC: Microsoft Visual C++ compiler (Windows)

Instructions

  1. Clone the repository

    git clone git@github.com:zbbsdsb/cppcraft.git
    cd cppcraft
  2. Create a build directory

    mkdir build
    cd build
  3. Configure with CMake

    cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x86-windows ..
  4. Build the project

    ninja
  5. Run the game

    .\cppcraft.exe

Controls

  • WASD: Move forward, left, backward, right
  • Space: Jump
  • Left Shift: Crouch
  • Mouse: Look around
  • Tab: Toggle mouse lock
  • Escape: Exit game

Project Structure

cppcraft/
├── include/          # Header files
│   ├── mesher/       # Mesh generation
│   ├── platform/     # Window, input, time management
│   ├── renderer/     # OpenGL rendering
│   └── world/        # Voxel world management
├── src/              # Source files
│   ├── mesher/       # Mesh generation implementation
│   ├── platform/     # Platform-specific implementation
│   ├── renderer/     # Rendering implementation
│   └── world/        # World management implementation
├── assets/           # Game assets
│   └── textures/     # Texture atlas
├── CMakeLists.txt    # CMake configuration
└── README.md         # This file

License

MIT License - see LICENSE file for details.

Author

zbbsdsb

About

A Minecraft-like game written entirely in C++ (customization welcome)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published