Build the Platformer Starter Project (Godot 4.x)
This guide walks you through creating the starter project used in the Game Engine Tools workshop.
It’s written so:
- A student can follow it alone.
- An instructor can keep it open while recording a build video.
Target “starter project” behavior
When you are done, the game should be true:
- A 2D player can move left/right and jump on a small area.
- The player has animations available:
idle,move,jump. - The player’s appearance is always the
idleanimation (even when moving). - There are gems the player can jump/move into.
- When the player touches a gem, the gem is removed.
Later, during the workshop, students will:
- Switch animations based on movement (idle/move/jump)
- Flip the sprite left/right
- Add scoring, then (if time) a winner message
Before you start
Godot
- Godot 4.x (latest stable).
- Web editor: https://editor.godotengine.org/releases/latest/
- Desktop install is fine too (steps are similar).
Assets
You need:
- A player sprite with three animations (or frames you can treat as):
idle,move,jump - A gem sprite
- A tiles/platform sprite (or a plain colored rectangle)
I’m using the Simplified Platformer Pack by Kenney, which is free and works well for a demo. You can use any art you like, but you should pay attention to the license and make sure you have permission to use it.
Part A — Create the project
A1) New project
- Open Godot.
- If using the web editor, you will get a warning message that you can click away and then click “Start Godot editor”
- Create a new project named:
platformer-starter-godot4
- Leave the defaults and click “Create”
- Switch to the “2D” workspace (top of the editor, toward the middle).
- In the filesystem area (lower left), create these folders (right-click on the parent folder,
res://, then click “New Folder”):
scenesscriptsassets- under assets, create subfolders:
spritessounds(optional, for later)
- under assets, create subfolders:
A2) Project settings
- Open Project > Project Settings.
- (Optional) Set a window size (
Display -> Window) that looks good for a workshop demo, for example:- Width:
960 - Height:
540
- Width:
- Close Project Settings.
A3) Import assets
- In the filesystem area, select the
assets/spritesfolder. - From your operating system file explorer, drag your sprites into that folder.
- For the
kenney_simplified-platformer-pack, unzip it and go to theTilesheetfolder and dragplatformerPack_character.pngandplatformPack_tilesheet.pngonto theassets/spritesin the filesystem area of Godot.
- For the
Part B — Create the main scene
We will make a “main” scene that holds the level and the player.
B1) Create and save the scene
- Create a new “Root Node” of type 2D Scene.
- Rename the root node to:
Main - Save the scene as:
scenes/main.tscn
B2) Add a ground platform (simple version)
Goal: a flat platform the player can stand on.
- Under
Main, add a StaticBody2D named:Ground - Under
Ground, add a CollisionShape2D - For the shape, choose WorldBoundaryShape2D
- (Temporary visuals) Under
Ground, add a ColorRect
Checklist:
- Player will have something to land on
- The level is small (fits on one screen)
Part C — Add the player
C1) Create the player scene/node
- Create a new scene, choosing “Other Node” and selecting CharacterBody2D.
- Rename the root node to:
Player - Save it as:
scenes/player.tscn - Under
Player, add a CollisionShape2D - Choose a CapsuleShape2D (or RectangleShape2D) and size it to the player.
- Switch back to the Main scene (
scenes/main.tscn). - Drag
scenes/player.tscninto the Main scene to create an instance of the player.
C2) Add the player script
- Switch to the player scene (
scenes/player.tscn). - Select
Player. - Click Attach Script (the scroll icon with the green plus sign in the top right of the editor).
- Use the template “CharacterBody2D: Basic Movement”.
C3) Add the player visuals
To start with, add a ColorRect as a placeholder so we can test movement.
- Under
Player, add a ColorRect - Set the ColorRect to a visible color and size it to match the player.
Now start the game and test that you can move the player left/right and jump. Close the Game view to continue.
Now we can improve the visuals with AnimatedSprite2D
- Under
Player, add AnimatedSprite2D named:AnimatedSprite2D - In the Inspector, create a new SpriteFrames resource
- For the “Sprite Frames” property, click the “New SpriteFrames” option, then click the “Edit” button that appears.
- Click the grid icon to “Add Frames from Sprite Sheet”.
- Select your player sprite sheet (for example,
platformerPack_character.png). - Zoom in enough to see the image, and adjust the horizontal and vertical frame counts to match your sprite sheet layout. For example, if there are 4 columns and 2 rows of images, you would set:
- Horizontal Frames:
4 - Vertical Frames:
2
- Horizontal Frames:
- Select the first frame, click “Add 1 Frame(s)”, and rename the animation from
defaulttoidle. - Create the other animations by selecting the appropriate frames and clicking “Add 1 Frame(s)” for each, naming them
moveandjump. - Make sure you on the 2D workspace and that the
AnimatedSprite2Dnode is selected, then play the animation, and adjust the FPS to make it look right (5.0 FPS works well for our example). - Select idle and then click the “Autoplay on Load” option to make sure this animation plays when the game starts.
Now that we have the AnimatedSprite2D set up, we can delete the ColorRect. Adjust the position and size of the AnimatedSprite2D if needed to align it with the collision shape.
Part D — Add gems
We’ll make one gem scene and then place several in the level.
D1) Create the Gem scene
- Create a new
Area2Dscene. - Rename the root node to:
Gem - Save it as:
scenes/gem.tscn
Add nodes:
- Under
Gem, add an AnimatedSprite2D for the gem art.- Set it up with the gem sprite (similar to how we set up the player sprite), but this time load the sprite sheet for the gem (for example,
platformPack_tilesheet.png). - “Horizontal” and “Verical” for the example should be set to 14 x 7.
- Create an animation with just the single frame of the gem you want to use.
- Set it up with the gem sprite (similar to how we set up the player sprite), but this time load the sprite sheet for the gem (for example,
- Under
Gem, add a CollisionShape2D- Choose CircleShape2D and size it to the gem.
D2) Gem pickup script
Attach a script to Gem (Area2D):
- Select
Gem. - Attach script:
gem.gd - Save it at:
scripts/gem.gd
extends Area2D
# Define a signal to emit when the gem is collected
signal collected(points: int)
func collect_gem() -> void:
# TODO: emit the "collected" signal with points (for example, 10)
#collected.emit(10)
queue_free()
func _on_body_entered(body: Node2D) -> void:
collect_gem()
Now connect the signal:
- Select
Gem. - Go to the Node tab.
- Double-click body_entered.
- Connect it to
gem.gdand choose_on_body_entered.
Checklist:
- Touching a gem removes it
- Touching with something else does nothing
- No score is changed
D3) Place gems in Main
- Open
scenes/main.tscn. - Drag
scenes/gem.tscninto the scene. - Duplicate it a few times and spread them around the platforms.
Part E — Final starter-project check
Run the game.
✅ Must-have checklist:
- Player moves left/right
- Player jumps
- Player collides with ground/platforms
- Gems disappear when collected
Part F — Improvements (optional)
- Add a Camera2D that follows the player.
- Add tile-based platforms using TileMap.
F1) Add a Camera2D
- In the Player scene, under
Player, add a Camera2D. - Adjust the zoom and limits as needed to make the level look good.
F2) Add tile-based platforms
- In the Main scene, delete the
Groundnode we made earlier. - Under
Main, add a TileMapLayer. - In the Inspector, create a new Tile Set resource for the TileMapLayer by selecting “TileSet”, then selecting “Edit”.
- Drag
platformPack_tilesheet.pngin the TileSet editor and let it create a new tiles in atlas. - Add a Physics Layer to the TileSet and set the collision shape for the tiles you want to use as platforms.
- Use the TileMapLayer by switching to the TileMap tab to paint platforms in the level.
F3) Add RichTextLabel for score
- In the Main scene, under
Main, add a CanvasLayer named:UI - Under
UI, add a RichTextLabel named:ScoreLabel - Position
ScoreLabelin the top left corner and set the text to: ` Score: 0` - You can later add logic to update the score as gems are collected.
Part F — Prepare the zip for students
Goal: create platformer-starter-godot4.zip.
Desktop Godot
- Close Godot.
- Zip the entire project folder (the one containing
project.godot). - Name the zip:
platformer-starter-godot4.zip
Web editor
- Project -> Tools -> Download Project Source
- Name the zip:
platformer-starter-godot4.zip
Final check:
- The zip contains
project.godotat the top level (or one folder down, consistently) - Importing the zip into Godot works