← Teacher guide Markdown for Prepare

Platforms: cheat sheet

Arcade advanced skills · Find each block in the MakeCode toolbox (the category is at the end of each line).

on game update

Runs its blocks every frame, about 30 times a second. Put an if here to keep checking something. Game.

game.onUpdate(function () {
    blocks
})
The block

check every frame

An if inside on game update is asked every frame, so it acts the moment its question becomes true.

game.onUpdate(function () {
    if (car.x > 160) {
        car.x = 0
    }
})
The block

sprite bottom

The y of the bottom edge of a sprite. Sprites; choose bottom in the x dropdown.

mySprite.bottom
The block

if

Runs the blocks inside only when the condition is true. Logic.

if (condition) {
    blocks
}
The block

set ay

Acceleration down: the sprite falls faster and faster, like gravity. Sprites; choose ay in the dropdown.

mySprite.ay = 300
The block

jump

A jump is a speed upwards (negative vy); gravity slows it and brings the sprite back down.

mySprite.vy = -150
The block