Time.js (system script)

From Spheriki

Jump to: navigation, search

Time.js is a system script which contains a function to delay the Sphere engine.


Contents

Usage

RequireSystemScript("time.js");


Variables and functions of time.js

  • Delay(milliseconds)
    • Delay the Sphere engine for the assigned amount of milliseconds. Nothing is done in this time.
    • 1 second = 1000 milliseconds.


Example

This example requires an image file named some_image.png to be resident in the images folder of your game:

RequireSystemScript("time.js");

var SomeImage = LoadImage("some_image.png");
SomeImage.blit(0, 0);
FlipScreen();
Delay(2000);  //Wait for 2 seconds


Notes

  • Map engine: Delay does nothing in the time it is pausing the engine, so nothing of the map engine will be drawn or animated within this time. Instead the game will show the last state of the map engine until the delay is over (except if you use FlipScreen() and/or other drawing functions, then it will show that instead).


See also

Personal tools