I'll build a 2D Minecraft clone with a full game loop leading to beating an Ender Dragon. Let me start by exploring the project structure.
Now I'll build the 2D Minecraft clone. Let me start with the game data and types.
Now let me create the HUD and inventory UI components.
Now let me try building the project to check for errors.
The build succeeded! Let me fix a few issues I noticed - the duplicate E-key handler and make the inventory toggle more responsive.
Let me rebuild to verify everything works.
Perfect! Let me create a README to document the game.
Let me clean up the unused drawItemIcon prop in HUD and verify the final build.
The 2D Minecraft clone is complete and builds successfully! Here's a summary of what I built:
🎮 Minecraft 2D - Features
Core Mechanics
- Procedurally generated world (400×200 tiles) with terrain, caves, trees, and ore veins
- Block-based mining with hardness-based mining times
- Tool tiers: Wood → Stone → Iron → Diamond (pickaxes, swords, axes)
- Block placement with 20+ block types
Game Systems
- Health system: 10 hearts (20 HP), regenerates when fed
- Hunger system: Depletes over time, causes starvation damage
- Inventory: 27 slots (9 hotbar + 18 storage)
- Crafting system: 20+ recipes with optional crafting table for advanced recipes
- Day/night cycle: 10-minute full cycle
Mobs & Combat
- Zombies (night, melee, drop meat/pearls)
- Skeletons (night, shoot arrows, drop rare items)
- Sheep & Pigs (passive, drop meat)
- Ender Dragon boss (200 HP, shoots fireballs, flies around)
Complete Game Loop (Beat the Game!)
- Chop trees → craft wood tools
- Mine stone → stone tools → iron → diamond
- Craft furnace → smelt ores
- Hunt zombies/skeletons for Ender Pearls + Blaze Rods
- Craft Eye of Ender → place it to create End Portal
- Enter The End dimension → defeat the Ender Dragon → Victory screen!
Controls
- WASD/Arrows + Space: Movement & jumping
- Left Click: Mine/Attack | Right Click: Place
- 1-9 / Scroll: Hotbar selection
- E: Inventory & Crafting | F: Eat food
Visual Polish
- Pixel-art rendering with procedurally drawn block textures
- Animated portals, particles, and mob sprites
- Day/night sky gradients with sun/moon
- Hearts, hunger bars, and item icons rendered in UI
- Start screen with instructions and victory screen
The game is immediately recognizable as Minecraft with the iconic grass/stone/dirt blocks, tool progression, crafting system, and the final dragon boss fight. The build produces a single 267KB HTML file.
Files built: src/game/types.ts, src/game/data.ts, src/game/world.ts, src/game/engine.ts, src/components/HUD.tsx, src/components/InventoryPanel.tsx, src/App.tsx, index.html, src/index.css, README.md