game¶
A global table of functions: game.<function>(…).
What a game asks of the program that runs it, as the script table game: ending the run (a menu's Quit), and whether the Escape key still ends it. A shipped game's menu does the first; one with a pause menu of its own does the second, since Escape is its key.
quit¶
game.quit: () -> ()
Ends the run at the end of this frame (the window closes, a headless run stops).
set_escape_quits¶
game.set_escape_quits: (quits: boolean) -> ()
Says whether the Escape key ends the run. A game that uses Escape for its own menu says false.
set_time_scale¶
game.set_time_scale: (scale: number) -> ()
Sets how fast game time runs (1 is normal, 0.5 half speed, 0 stops it, 2 doubles it), from 0 to 100; a larger number is 100. It scales the physics, the world's systems and the game clock of task (task.wait, task.delay, task.every, task.time); task.wait_real, audio, the user interface and input keep real time. A new game starts at 1.
time_scale¶
game.time_scale: () -> number
The time scale set by set_time_scale (1 by default).