Neon Dungeon: Rogue Crawler · Step 2 of 4

Keyboard Controls & Vector Movement

Now that our hero is rendered, let's give the player movement capabilities! In this step, you will capture keydown/keyup events (or key states), update velocity vectors (vx, vy), and update position on each frame (x += vx, y += vy). You will also enforce screen boundary constraints so the player doesn't wander off grid.

What you will learn

Open this interactive lesson · Browse all lessons

In the editor, complete the marked TODOs. Use Stuck on a TODO? to reveal hints or a worked example, then run the lesson checks.