reset

Reset the game.

reset game
JavaScript
function game.reset(): void;
Python
def game.reset(): None

Resetting the game makes the game program stop. The game program is then restarted. If the game is running on a device, this is similar to the reset button

Example

Send a sprite moving from the left side of the screen toward the right. When the sprite reaches the right side of the screen, reset the game program.

mySpriterightscreen width‏>reset gameifthenon game updatePlayerspriteof kindmySprite0mySprite30setvx (velocity x)tosetlefttosetmySpritetoenum SpriteKind {    Player,    Enemy}on start

See also

over