Learning how to make a platformer in MakeCode Arcade comes down to six pieces: a player sprite, a tilemap with solid walls, gravity, a jump that only works on the ground, a camera that follows the player, and something to collect or reach. Get those right and you have a playable game in an afternoon. This guide walks through each piece in Blocks terms, gives you the full JavaScript, then covers jump feel, the bugs that trip up almost everyone, and what to do when your game outgrows Arcade.
What you need before you start
MakeCode Arcade is Microsoft’s browser-based editor for small retro games. You drag code blocks together, or switch to JavaScript or Python, and a simulator on the left runs your game instantly. The same MakeCode family is also one of the official code editors for the BBC micro:bit, which is why it shows up so often in classrooms.
A few terms you will see throughout:
- Sprite: any moving object in the game, such as the player, an enemy or a projectile. Each sprite has a kind (Player, Enemy, Food and so on) that you use to decide what happens when sprites touch.
- Tile: a small square image, 16×16 pixels by default, used to build the world.
- Tilemap: a grid of tiles that forms a level. In MakeCode Arcade you paint it in a built-in editor.
- Wall: a tilemap cell marked as solid. Sprites stop when they hit it. Painting a tile does not make it solid; marking it as a wall does.
- Velocity and acceleration:
vx/vyare how fast a sprite moves each second, andax/aychange that speed over time. Gravity is simply a constant downwarday.
You need nothing installed. Open the Arcade editor, start a new project, and keep the simulator visible so you can test after every step.
How to make a platformer in MakeCode Arcade: the core steps
Build in this order. Each step is testable on its own, which makes bugs easy to spot.
Step 1: Create the player
From the Sprites category, drag set mySprite to sprite of kind Player into on start. Click the grey image square to draw your hero. Keep it smaller than a tile (around 8 to 14 pixels tall) so it fits through one-tile gaps. Rename the variable to hero so your code stays readable.
Step 2: Draw a level with walls
From Scene, add set tilemap to and open the tilemap editor. Pick a grass or stone tile for ground and paint a floor, a few floating platforms and a gap or two. Then switch to the wall tool and paint walls over every ground and platform cell. This is the step people skip, and it is why their hero falls through the floor.
While you are in the asset editor, create three extra tiles and name them coin, spikes and flag. Place them around the level but do not mark them as walls, because the player needs to overlap them.
Step 3: Move left and right only
Add move hero with buttons from Controller, then expand it with the plus icon and set vx to about 90 and vy to 0. The zero matters: if the controller also drives vertical speed, it overwrites gravity every frame and your jump will never work.
Step 4: Add gravity
From Sprites, use set hero ay to 400. Your hero now falls and lands on wall tiles. Values between 300 and 500 feel like a classic platformer at Arcade’s resolution; lower feels floaty, higher feels heavy.
Step 5: Jump, but only from the ground
Add on A button pressed. Inside it, use an if block with is hero hitting wall bottom, and set hero vy to a negative number such as -170. Negative is up in screen coordinates. Without the ground check, players can tap A in midair and fly forever.
Step 6: Camera, coins, hazards and a goal
Add camera follow sprite hero so levels can be wider than one screen. Then use on sprite of kind Player overlaps tile three times: coins add a point and get replaced by an empty tile, spikes end the game with a loss, and the flag ends it with a win. That is a complete, winnable game.

The full platformer code in JavaScript
Here is the same game as MakeCode Arcade JavaScript. Paste it into the JavaScript tab after you have drawn a tilemap named level1 and tiles named coin, spikes and flag; the editor converts it back to blocks if you want to switch views.
const GRAVITY = 400
const JUMP_HEIGHT = 36 // pixels, a little over two 16 px tiles
scene.setBackgroundColor(9)
tiles.setCurrentTilemap(tilemap`level1`)
let hero = sprites.create(img`
. . 4 4 4 4 . .
. 4 4 4 4 4 4 .
. 4 f 4 4 f 4 .
. 4 4 4 4 4 4 .
. . 4 4 4 4 . .
. 2 2 2 2 2 2 .
. 2 . 2 2 . 2 .
. 8 . . . . 8 .
`, SpriteKind.Player)
controller.moveSprite(hero, 90, 0) // vy must be 0 so gravity works
hero.ay = GRAVITY
tiles.placeOnTile(hero, tiles.getTileLocation(1, 5))
scene.cameraFollowSprite(hero)
info.setScore(0)
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
if (hero.isHittingTile(CollisionDirection.Bottom)) {
// v = sqrt(2 * g * h) gives an exact jump height
hero.vy = -Math.sqrt(2 * GRAVITY * JUMP_HEIGHT)
}
})
scene.onOverlapTile(SpriteKind.Player, assets.tile`coin`, function (sprite, location) {
tiles.setTileAt(location, assets.tile`transparency16`)
info.changeScoreBy(1)
})
scene.onOverlapTile(SpriteKind.Player, assets.tile`spikes`, function (sprite, location) {
game.gameOver(false)
})
scene.onOverlapTile(SpriteKind.Player, assets.tile`flag`, function (sprite, location) {
game.gameOver(true)
})
Change the numbers in getTileLocation(1, 5) to a column and row that sit just above your floor. The jump line is worth understanding: instead of guessing a velocity, you state the height you want in pixels and the physics formula gives you the launch speed. With gravity at 400 and a 36-pixel target, the hero clears a two-tile wall with a few pixels to spare.





