Skip to content

kkawula/minecraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft clone in C++

This is a simple game engine project, that implements something similar to minecraft.

Contributions are welcome!!

TODO

  • change the way of storing chunks, delete smart pointers from map
  • add rendering of missing blocks
  • add clouds rendering
  • improve water mesh generator

Installation and Setup

  1. Vcpkg: We are using the Vcpkg package manager to install project dependencies. This project is oriented to be cross-platform, and Vcpkg provides an easy way to install packages on various operating systems. You can read more here and here.

  2. Git Submodules: You don't need to install vcpkg manually, it is included as a git submodule (shallow, depth==1). You can clone the project using the following command:

git clone --recursive --shallow-submodules https://github.com/taylor-swif/minecraft.git
  1. Bootstrapping Vcpkg: After cloning the project, you can bootstrap vcpkg using the following commands:

MacOS/Linux:

./vcpkg/bootstrap-vcpkg.sh -disableMetrics

Windows:

./vcpkg/bootstrap-vcpkg.bat
  1. Install Dependencies: Now you can install the project dependencies using the following command: vcpkg install glfw3 glew glad imgui
./vcpkg/vcpkg install opengl glad glew glfw3 glm imgui

WARNING

Read information's in your terminal while installing dependencies. Probably you will be missing some dependencies, so you need to install them manually. There should be a message like this:

MacOS:

brew install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config

Ubuntu:

sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config

Then repeat 4th step.

Building the Project

  1. CMake: We are using CMake to build the project. It is automated, so you do not have to do anything. For example, if you are using MacOS/Linux, you can use the following command to build the project:
mkdir build
cd build
cmake ../
make all
./minecraft

or

Green magic button in your IDE e.g. CLion.

But for multiplatform development, I recommend using the terminal. WSL should work fine.

Controls

  • Esc - Exit
  • WASD - Move
  • Space - Jump
  • Left Shift - Sprint
  • M - Change to flight mode
  • Left mouse button - Destroy block
  • Right mouse button - Place block
  • /<blockID> Enter - Select block

Blocks

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

Non-standard libraries

  • GLFW: Window creation and input handling
  • GLAD: OpenGL loader
  • GLM: Math library
  • std_image: Image loading library
  • Perlin noise: Noise generation library
  • stb_image: Image loading library

About code

Some screenshots from development process

image image image image image image image

Final results

image image image image image

Credits

Requirements

cmake

About

Minecraft clone made using c++ and openGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages