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:

  1. All screens are hidden

  2. The playing global is set to false

  3. The game is fully reset (state, history, storage)

  4. The main menu is displayed

  5. 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 end action 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

  • Jump - Navigate to different labels

  • Clear - Clear the text box

Last updated

Was this helpful?