Add a controllable player object that moves with WASD keys.
Movement = Input → Update Position → Render. The player presses a key, the game updates the player's position in state, and the renderer shows the new position. This happens every frame.
Player cube = Hero exploring Manhattan. The red cube represents your character moving through dangerous streets.
Player cube = Developer walking between lots. The red cube represents you surveying your construction sites.
Create the player mesh:
Track keyboard input with keydown/keyup:
Define movement speed and update position inside the animation loop:
Cube moves smoothly with WASD. Camera follows or stays appropriately angled.
No jumping. No sprinting. No collision detection. No diagonal speed normalization. Just basic 4-direction movement.
Movement speed too high — the player teleports across the screen instead of moving smoothly.
Forgetting to update position inside the animation loop — movement only happens once or not at all.
Not using keydown/keyup tracking — relying on keypress alone causes stuttering movement instead of smooth gliding.
Let them play with movement speed. "What breaks if speed is 100?" This teaches frame-rate dependent movement. The cube IS the player — no character model needed for v1.