Settings

The engine provides two separate settings systems: Engine Settings shared across all games, and Game Settings specific to each game.

Both are shown to the player in the game menu and can be read/written from scripts.


Engine Settings

Engine-level settings are shared across all games and persisted to the browser's localStorage. They survive page refreshes, game restarts, and switching between games.

Built-in Settings

IDTypeDefaultDescription
music_volumechooseOne (0-100)20Music volume percentage
sound_volumechooseOne (0-100)80Sound effects volume percentage
font_sizechooseOne (10-40)20UI font size in pixels
typing_speedchooseOnefastText typing animation speed (none, slow, medium, fast, very_fast)

API

// Read
const volume = game.getEngineSetting('music_volume');
const speed = game.getEngineSetting('typing_speed');

// Write (auto-persisted to localStorage)
game.setEngineSetting('music_volume', 50);
game.setEngineSetting('typing_speed', 'none');

The player can also change these directly via Engine Settings in the game menu.


Game Settings

Game settings are specific to your game and persisted in save files. They are defined in the engine editor under General tab and shown inside Game Settings in the game menu (only visible when at least one setting is defined).

Defining Settings

Open the engine editor and navigate to Game Settings. Each entry has:

FieldDescription
idUnique identifier used in code
typeValue type: title, string, number, boolean, chooseOne, chooseMany, color
labelDisplay name shown in the menu
tooltipOptional help text
default_valueInitial value (as string)
valuesAvailable options (for chooseOne/chooseMany)
orderDisplay order in the menu
localizeValuesWhether option values should be passed through locale

The title type creates a section header (not a setting) to organize the menu visually.

API

// Read
const difficulty = game.getGameSetting('difficulty');
const showHints = game.getGameSetting('show_hints');

// Write (persisted in save files)
game.setGameSetting('difficulty', 'hard');
game.setGameSetting('show_hints', false);

Example: Difficulty Setting

Define in the editor:

FieldValue
iddifficulty
typechooseOne
labelDifficulty
default_valuenormal
valueseasy, normal, hard

Use in scripts:

const diff = game.getGameSetting('difficulty');
const damageMultiplier = diff === 'hard' ? 1.5 : diff === 'easy' ? 0.5 : 1;

Example: Toggle Setting

FieldValue
idshow_damage_numbers
typeboolean
labelShow Damage Numbers
default_valuetrue
if (game.getGameSetting('show_damage_numbers')) {
    // display floating damage text
}

Engine vs Game Settings

Engine SettingsGame Settings
ScopeAll gamesOne game
PersistenceBrowser localStorageSave files
Defined byEngine (built-in)Game developer (editor)
Menu locationEngine SettingsGame Settings
Readgame.getEngineSetting(key)game.getGameSetting(key)
Writegame.setEngineSetting(key, value)game.setGameSetting(key, value)