Roguelike: Part 1: Into the Cave
Create tile-based dungeon rooms, implement grid-snapped movement with Input actions, and build the core game loop for a turn-based roguelike in GDScript.
No login required.
The World
Every roguelike starts with a grid. You'll declare the scene type, define tile constants for walls and floors, and wire up the TileMapLayer. Watch the game panel -- the dungeon grid appears once the tilemap is connected in beat 4.
TileMapLayer and atlas constants are the foundation of every tile-based game in Godot.
Loading game...
Click the game window to interact with it
What You'll Build
You will create a tile-based dungeon room with a player that moves on a grid. Movement is turn-based: each key press advances the player by one tile. The dungeon is drawn on a TileMapLayer with wall and floor tiles. This part establishes the core loop that every later part builds on.
Learning Goals
- ✓TileMapLayer for grid-based level design
- ✓Grid-snapped movement with Input.is_action_just_pressed()
- ✓Converting pixel positions to tile coordinates and back
- ✓Basic turn-based game loop structure
GDScript Concepts in This Part
Tips
- ✨Use Input.is_action_just_pressed() instead of is_action_pressed() for turn-based games — it fires once per key press, giving you discrete turns.
- ✨Store positions in grid coordinates (Vector2i) and convert to pixels only for display.