dorkhub

minecraft

Minecraft clone from scratch with only OpenGL

GianlucaP106
Go39522 forksupdated 1 year ago
git clone https://github.com/GianlucaP106/minecraft.gitGianlucaP106/minecraft

Minecraft from scratch minecraft

A Minecraft clone from scratch with only OpenGL. No game engines or frameworks.

demo.mp4
Screenshot 2025-05-11 at 12 48 01 AM
Screenshot 2025-05-11 at 9 50 57 PM Screenshot 2025-05-11 at 9 50 12 PM
Screenshot 2025-05-11 at 9 52 20 PM demo7

✨ Features

  • 🌍 Infinite & procedurally generated terrain using Perlin noise
  • ⚙️ Physics engine with collision detection and response
  • 💡 Dynamic lighting with shadows and day/night cycle 🌞🌙
  • 🧱 Block placement and destruction
  • 🌳 Tree generation & basic cave systems 🕳️
  • 📦 Dynamic chunk loading/unloading based on player position
  • 🎯 Frustum culling for rendering optimization
  • 🎒 Simple inventory system with hotbar (1–9)
  • 🕹️ Flying mode for creative exploration
  • 🗺️ Biome-based terrain variation

🛠️ Installation

# Clone the repository
git clone https://github.com/GianlucaP106/minecraft minecraft && cd minecraft

# Run the game (requires Go)
go run .

📦 Make sure you have Go installed: https://go.dev/dl/


🎮 Controls

Action Key/Mouse
Move W, A, S, D
Jump Space
Toggle Fly F
Look Around Mouse
Break Block Left Click
Place Block Right Click
Select Item 1-9

🧪 Technical Highlights

🖼️ Graphics

  • Uses OpenGL 4.1
  • Custom shader programs for blocks, UI, and lighting
  • Frustum culling for performance optimization

🌄 World Generation

  • Multi-octave Perlin noise for terrain shaping
  • Biome system to vary landscape types
  • Procedural caves and tree generation
  • Real-time chunk loading/unloading

⚙️ Physics

  • Custom physics engine with rigid body dynamics
  • Block-based collision detection
  • Jumping & flying mechanics

🧩 Architecture Overview

architecture

The engine follows a component-based design. Key systems include:

  • 🎮 Game: Core game loop and simulation
  • 🌍 World system: Chunk loading, block updates
  • 🧬 Generator: Terrain, trees, caves, biomes
  • ⚙️ Physics engine: Collision, movement, response
  • 🧑 Player: Camera, controls, raycasting

📦 Dependencies

This project uses ONLY the following Go packages:


⚠️ Disclaimer

This project is developed for educational and non-commercial purposes only.
It is not affiliated with or endorsed by Mojang, Microsoft, or any related entities.

more like this

search

search projects, people, and tags