Skip to content

Your first platformer

A hero that runs and jumps, ground to stand on, a coin to grab and a slime to dodge, in a few minutes and with no code.

Make a project: File → New Project (Ctrl+Shift+N), name it My Platformer, pick the Empty template and Create.

Start a new project from the Empty template (File, New Project). It opens on a scene with just a camera. The Entity menu makes ready-made things, sorted by kind, and the first one a platformer needs is its hero, under Characters.

  1. Choose Entity → Characters → Platformer Player.

The hero is an orange box that already runs, jumps and falls: a Body gives it gravity and a collision shape, and Platformer Movement reads the arrow keys, WASD and Space. Its Inspector tunes how it feels, which you will try in a moment.

A hero (the editor)
  1. Choose Entity → Basics → Sprite.
  2. Rename it Ground (F2).
  3. In the Inspector, set Transform → Position to 0, -3, 0.
  4. In the Inspector, set Sprite → Size to 16, 1.
  5. In the Inspector, set Sprite → Tint to #484B55.
  6. Click Add Component and add Box Collider.
  7. In the Inspector, set Box Collider → Size to 16, 1.

A level is made of boxes. A Sprite draws one, and a Box Collider makes it solid. Without a Body it never moves, so it is the floor.

  1. Choose Entity → Basics → Sprite.
  2. Rename it Ledge (F2).
  3. In the Inspector, set Transform → Position to 4, -0.8, 0.
  4. In the Inspector, set Sprite → Size to 4, 0.5.
  5. In the Inspector, set Sprite → Tint to #6B707D.
  6. Click Add Component and add Box Collider.
  7. In the Inspector, set Box Collider → Size to 4, 0.5.
  8. In the Inspector, set Box Collider → One Way to true.

A second box makes a ledge. One Way lets the hero jump up through it and land on top.

Ground to stand on (the editor)
  1. Press F5 to play.
  2. In the game, hold Right for 0.6 seconds.
  3. In the game, press Space.

Press F5 to play. Run with the arrow keys or A and D, and jump with Space. The game plays in the Game tab, and Shift+F5 stops it and puts everything back.

  1. Press Shift+F5 to stop.
  1. Select Player in the Hierarchy.
  2. In the Inspector, set Platformer Movement → Jump Height to 3.2.

How the hero moves is a handful of numbers in the Inspector. Jump Height is how high a jump goes, in world units. Try 3.2 and play again: change a number, press F5, feel it.

Make it feel right (the editor)
  1. Choose Entity → Basics → Sprite.
  2. Rename it Coin (F2).
  3. In the Inspector, set Transform → Position to 4, -1.8, 0.
  4. In the Inspector, set Sprite → Size to 0.5, 0.5.
  5. In the Inspector, set Sprite → Tint to #E3B341.
  6. Click Add Component and add Circle Collider.
  7. In the Inspector, set Circle Collider → Is Trigger to true.
  8. Click Add Component and add Pickup.
  9. In the Inspector, set Pickup → Layers to Player.

A coin is a sprite with a trigger collider, which detects touches without blocking, and a Pickup. Pickup collects it when something on the Player layer touches it, and sends a Score message.

  1. Choose Entity → Basics → Text.
  2. Rename it Score (F2).
  3. In the Inspector, set Transform → Position to -6, 4, 0.
  4. In the Inspector, set Text → Value to Score: 0.
  5. Click Add Component and add Counter.

A Text shows words in the world, and a Counter adds up Score messages into it. That is a whole scoring system without a line of code.

A coin and a score (the editor)
  1. Select Player in the Hierarchy.
  2. Click Add Component and add Health.

Enemies hurt, so the hero needs Health. Add Component finds what you type.

  1. Choose Entity → Basics → Sprite.
  2. Rename it Slime (F2).
  3. In the Inspector, set Transform → Position to -4, -2.1, 0.
  4. In the Inspector, set Sprite → Size to 0.8, 0.8.
  5. In the Inspector, set Sprite → Tint to #57AB5A.
  6. Click Add Component and add Patrol.
  7. In the Inspector, set Box Collider → Size to 0.8, 0.8.
  8. Click Add Component and add Damage On Touch.
  9. In the Inspector, set Damage On Touch → Layers to Player.

Patrol walks back and forth and brings the collider and body it needs; the collider is made the slime’s size. Damage On Touch hurts anything on the Player layer it meets.

A slime to dodge (the editor)
  1. Press F5 to play.
  2. In the game, hold Right for 1 second.
  3. In the game, press Space.

Run right along the ground and the coin is yours: the score counts up.

Play the finished level (the game)
  1. Press Shift+F5 to stop.

That is a platformer. Save the scene with Ctrl+S, then build it into a single exe with Game, Build Game. Next steps: draw your own sprites with the Sprite Painter, paint a tilemap level, and add sounds from the Sound Maker.