Minecraft 8
By Just Sparrow
Based on the following code

Minecraft 7
Just Sparrow
16 views · 1mo ago
About
This project is a recreate of Minecraft 7 — built by clicking "Recreate" and giving Claude (by Anthropic) an additional prompt. The biggest upgrade: Pointer Lock controls. Instead of click-and-drag to look around, you now click the canvas once to lock your cursor, then move the mouse freely to rotate the camera — just like real Minecraft. Press Escape to release. A "Click to play" overlay guides you when pointer lock is not active.
Prompt Used
Replace the current mouse-drag camera rotation with proper Pointer Lock controls. When the user clicks on the canvas, call requestPointerLock() to capture the cursor. While pointer lock is active, use movementX / movementY from mousemove events to rotate the camera yaw and pitch continuously — no click-and-drag needed. Hide the crosshair and show a "Click to play" overlay when pointer lock is not active; once locked, show the crosshair and hide the overlay. Handle pointerlockchange and pointerlockerror events properly. Press Escape to release pointer lock (this is handled natively by the browser). Left click and right click for block placement / removal should only work while pointer lock is active.
How to Use
Getting Started
- Click the canvas to lock your cursor and start playing
- Press Escape to release the cursor
Movement
- W — Move forward
- A — Move left
- S — Move backward
- D — Move right
- Space — Jump
Camera
- Move your mouse to look around (while pointer lock is active)
Block Selection
- Click an inventory slot at the bottom of the screen, or press 1 (Grass), 2 (Dirt), 3 (Stone), 4 (Wood)
Building & Breaking
- Left-click to place the selected block type
- Right-click to remove a block
- A crosshair in the center of the screen shows where you're aiming
Note: Pointer Lock requires the page to be the top-level window. If running inside an iframe, you may need to open the project in a new tab for full functionality.
Want to take it further? Click "Recreate" to build on this version — try adding a minimap, more block types, or sound effects!
More
If you enjoyed this, please hit the like button and subscribe! Your support helps us create more cool stuff on Coddie.
Loading comments...
Other Codes
No other codes yet