runtime

Get the time in milliseconds since the game was started.

time since start (ms)
JavaScript
function game.runtime(): number;
Python
def game.runtime(): number

Returns

  • a number which is the amount of time in millseconds since the game started.

Example

Move a sprite across the screen. When 5 seconds has elapsed, stop the sprite and show the game time.

Playerspriteof kindmySprite105000mySprite0"Game time = "time since start (ms)joinshow long textbottomsetvx (velocity x)topausemssetvx (velocity x)tosetmySpritetoenum SpriteKind {    Player,    Enemy}on start

See also

start countdown