End
End your game
Description
'end'The end action terminates the game and returns to the main menu. It resets all storage, actions, and components to their initial state.
Action ID: End
Reversible: No
Requires User Interaction: No
Behavior
When the end action is executed:
All screens are hidden
The
playingglobal is set tofalseThe game is fully reset (state, history, storage)
The main menu is displayed
UI elements are restored to their initial state
Usage
Every script path should end with the end action:
Multiple Endings
You can have multiple endings in your game:
Keyboard Shortcut
Players can trigger a quit confirmation using Shift+Q during gameplay. This displays an alert with:
Quit button - Ends the game
Cancel button - Dismisses the alert
This shortcut is automatically registered when the game initializes.
Electron/Desktop Integration
When running in Electron (desktop builds), if the game is not currently playing and the quit action is triggered, a quit request is sent to the Electron process to close the application window.
Important Notes
[!WARNING] The
endaction is not reversible. Once executed, the player cannot use the back button to return to the game. Make sure to provide save opportunities before critical endings.
Examples
Simple Ending
Ending with Credits
Ending After Unlocking Gallery
Related Actions
Last updated
Was this helpful?