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
})
Arcade advanced skills · Find each block in the MakeCode toolbox (the category is at the end of each line).
Runs its blocks every frame, about 30 times a second. Put an if here to keep checking something. Game.
game.onUpdate(function () {
blocks
})
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 y of the bottom edge of a sprite. Sprites; choose bottom in the x dropdown.
mySprite.bottom
Runs the blocks inside only when the condition is true. Logic.
if (condition) {
blocks
}
Acceleration down: the sprite falls faster and faster, like gravity. Sprites; choose ay in the dropdown.
mySprite.ay = 300
A jump is a speed upwards (negative vy); gravity slows it and brings the sprite back down.
mySprite.vy = -150