Syntax Cache
BlogMethodFeaturesHow It WorksBuild a Game
All Games
  1. Home
  2. GDScript
  3. Build a Game
  4. Arena Survivor
  5. Part 1: Your First 2D Game

Arena Survivor: Part 1: Your First 2D Game

Set up a Godot 4 project, create a CharacterBody2D player with keyboard movement using velocity and move_and_slide(), and build your first playable 2D scene.

No login required.

Chapter 1

Setting Up Your Player

Every Godot game starts with a script. In the next 3 steps you'll declare a player node, set its speed, and connect its sprite. Watch the game panel: each line you write changes something visible.

Game objects in Godot are scripts attached to nodes, so this is where everything starts.

Loading game...

Click the game window to interact with it

What You'll Build

You will create a player character that moves in all four directions using keyboard input. The player is a CharacterBody2D node with a Sprite2D and CollisionShape2D, controlled by Input.get_vector() and move_and_slide(). By the end of this part you have a character that responds to WASD or arrow keys in a Godot 4 scene.

Learning Goals

  • ✓extends CharacterBody2D and the node lifecycle (_ready, _physics_process)
  • ✓Input.get_vector() for four-directional movement
  • ✓velocity assignment and move_and_slide() for physics-based movement
  • ✓Basic scene tree structure: Node2D, Sprite2D, CollisionShape2D

GDScript Concepts in This Part

GDScript Foundations PracticeLearn the first lines of every Godot 4 script: extends, typed vars, @export, @onready, signals, and lifecycle callbacks (_init, _ready). Includes copy-paste templates + drills.GDScript Movement PracticeCopy-paste movement scripts for Godot 4: top-down + platformer. Learn velocity, move_and_slide(), _physics_process vs _process, delta rules, slope snapping, and Physics Interpolation jitter fixes.

Tips

  • ✨Use Input.get_vector() instead of checking each key individually — it handles diagonals and returns a normalized vector automatically.
  • ✨Always call move_and_slide() after setting velocity; it handles delta time internally.
Syntax Cache

Build syntax muscle memory with spaced repetition.

Product

  • Pricing
  • Our Method
  • Daily Practice
  • Design Patterns
  • Interview Prep

Resources

  • Blog
  • Compare
  • Cheat Sheets
  • Vibe Coding
  • Muscle Memory

Languages

  • Python
  • JavaScript
  • TypeScript
  • Rust
  • SQL
  • GDScript

Legal

  • Terms
  • Privacy
  • Contact

© 2026 Syntax Cache

Cancel anytime in 2 clicks. Keep access until the end of your billing period.

No refunds for partial billing periods.