Blockgame
Overview
This project is a super basic 3D block game with heavy inspiration taken from early alpha versions of Minecraft, implemented in Java. It includes fundamental functionalities such as player movement, block breaking/placing, world generation, and a complete block-based building system.
Features
Player Movement & Physics
- WASD movement with mouse look
- Gravity and jumping mechanics
- Collision detection with blocks
- Anti-stuck system (automatically frees player if trapped inside blocks)
Block System
- Multiple block types: Grass, Dirt, and Cobblestone
- Realistic grass-to-dirt conversion (grass becomes dirt when covered, dirt becomes grass when exposed)
- Procedurally generated textures (16x16)
- Proper block rendering with appropriate textures
Hotbar & Inventory
- 9-slot hotbar system
- Mouse scroll wheel or number keys (1-9) for block selection
- Visual hotbar UI with block icons
- Only place blocks when holding them (empty hand can't place blocks)
World Generation
- 64x64 world with 3-layer structure
- Grass surface layer
- Two cobblestone foundation layers underneath
- Layered world geology for realistic mining
User Interface
- Crosshair for precise block targeting
- Hotbar display showing available blocks
- Clean, minimalist UI design
Building & Mining
- Left-click to break any block
- Enter key to place selected block
- 5-block reach distance
- Cooldown system prevents spam clicking
Controls
Movement
- WASD: Move forward/backward/left/right
- Mouse: Look around (camera control)
- Space: Jump
- Escape: Exit game
Building & Mining
- Left Click: Break blocks
- Enter: Place selected block
- Mouse Scroll: Change hotbar selection
- Number Keys (1-9): Select hotbar slot directly
Hotbar
- Slot 1: Grass blocks
- Slot 2: Dirt blocks
- Slot 3: Cobblestone blocks
- Slots 4-9: Empty (available for future block types)
Requirements
- Java Development Kit (JDK) 8 or higher
- Maven
Setup Instructions
- Clone the repository:
git clone https://github.com/djleamen/blockgame.git
- Navigate to the project directory:
cd blockgame
- Build the project using Maven:
mvn clean install
mvn clean package
- Run the game:
java -jar target/mc-clone-1.0-SNAPSHOT-shaded.jar
Mac Users:
java -XstartOnFirstThread -jar target/mc-clone-1.0-SNAPSHOT-shaded.jar
Log in or sign up for Devpost to join the conversation.