Legacy:RestartGame

From Spherical
Jump to: navigation, search

This simply restarts the game.

Usage

RestartGame();



Examples

RestartGame();

Restarts the game.

function SwitchResolution(width, height)
{
  var proj = OpenFile("../game.sgm");
  proj.write("screen_height", height);
  proj.write("screen_width", width);
  proj.flush();
  proj.close();
  RestartGame();
}

A function that allows you to easily change the resolution of the current game. The file operations set the game screen dimensions and save them. The RestartGame() call reinitialises Sphere, at which point the Sphere engine will actually change its size due to the numbers written in the game project file earlier.

Notes

All variables and things Sphere loaded into memory will be cleaned from memory as if you just started the game.

See also

API:Engine/navbox