Read our guide on Changing Scenes and Pausing for an explanation of these blocks.
Switches to a different scene using a fade in/out transition.
//Using fade in and out
switchScene([SCENE].getID(), createFadeOut([NUMBER], [COLOR]), createFadeIn([NUMBER], [COLOR]));
//Other Transition types
createBlindsOut([NUMBER], [COLOR]), createBlindsIn([NUMBER], [COLOR]),
createBubblesOut([NUMBER], [COLOR]), createBubblesIn([NUMBER], [COLOR]),
createCircleOut([NUMBER], [COLOR]), createCircleIn([NUMBER], [COLOR]),
createPixelizeOut([NUMBER], [COLOR]), createPixelizeIn([NUMBER], [COLOR]),
createRectangleOut([NUMBER], [COLOR]), createRectangleIn([NUMBER], [COLOR])
Switches to a different scene using a crossfade or slide transition.
switchScene([SCENE].getID(), null, createCrossfadeTransition([NUMBER]));
switchScene([SCENE].getID(), null, createSlideUpTransition([NUMBER]));
switchScene([SCENE].getID(), null, createSlideDownTransition([NUMBER]));
switchScene([SCENE].getID(), null, createSlideLeftTransition([NUMBER]));
switchScene([SCENE].getID(), null, createSlideRightTransition([NUMBER]));
Reloads the current scene using a fade in/out transition.
//Using fade in and out
reloadCurrentScene(createFadeOut([NUMBER], [COLOR]), createFadeIn([NUMBER], [COLOR]));
//Other Transition types
createBlindsOut([NUMBER], [COLOR]), createBlindsIn([NUMBER], [COLOR]),
createBubblesOut([NUMBER], [COLOR]), createBubblesIn([NUMBER], [COLOR]),
createCircleOut([NUMBER], [COLOR]), createCircleIn([NUMBER], [COLOR]),
createPixelizeOut([NUMBER], [COLOR]), createPixelizeIn([NUMBER], [COLOR]),
createRectangleOut([NUMBER], [COLOR]), createRectangleIn([NUMBER], [COLOR])
Reloads the current scene using a crossfade or slide transition.
reloadCurrentScene(null, createCrossfadeTransition([NUMBER]));
reloadCurrentScene(null, createSlideUpTransition([NUMBER]));
reloadCurrentScene(null, createSlideDownTransition([NUMBER]));
reloadCurrentScene(null, createSlideLeftTransition([NUMBER]));
reloadCurrentScene(null, createSlideRightTransition([NUMBER]));
Returns a Scene by its name. Use inside a scene-switching block for an easy way to switch scenes by name.
GameModel.get().scenes.get(getIDForScene([TEXT]))
Returns true
if the game is in the process of transitioning to another scene, transitioning from another scene, or reloading.
isTransitioning()
Notifies the game to creates an actor in the next scene (or the reload of the current one). This is useful, for example, for top-down games (like Zelda) where you'll exit the screen on one side and want to seamlessly reappear on the "correct" side.
createActorInNextScene([ACTOR TYPE], [NUMBER], [NUMBER], Script.FRONT);
createActorInNextScene([ACTOR TYPE], [NUMBER], [NUMBER], Script.MIDDLE);
createActorInNextScene([ACTOR TYPE], [NUMBER], [NUMBER], Script.BACK);
Pauses (or unpauses) the game. You can selectively opt out actors on the Physics > Advanced page of their editor.
engine.pause();
engine.unpause();
Returns true
if the game is paused.
engine.isPaused()