Overview
ScoreManager is a global autoload singleton that persists all player data including:
- High scores for each minigame
- Coin balance
- Inventory items (shells and accessories)
- Equipped cosmetic items
user://high_scores.cfg using Godot’s ConfigFile system.
Signals
Emitted when the player equips a new shell or accessory. Used by the character visual and store UI to update appearances.
Coin Management
add_coins()
Adds coins to the player’s balance and saves to disk.Number of coins to add (can be positive or negative)
No return value
get_coins()
Retrieve the player’s current coin balance.Current number of coins
Inventory Management
add_to_inventory()
Adds an item to the player’s inventory if not already owned. Automatically saves to disk.Name of the item to add (e.g., “Caparazón Azul”, “Corona”)
No return value
get_inventory()
Returns the player’s full inventory as an array of item names.Array of String item names owned by the player
equip_item()
Equips an item from inventory. Emitsskin_updated signal to refresh character visuals.
Equipment slot: either
"caparazon" (shell) or "accesorio" (accessory)Name of item to equip, or
"default"/"none" for default appearanceNo return value
get_equipped_item()
Returns the currently equipped item for a category.Equipment slot:
"caparazon" or "accesorio"Name of currently equipped item, or
"none"/"default" if nothing equippedis_equipped()
Checks if a specific item is currently equipped in either slot.Item name to check
true if the item is equipped, false otherwiseHigh Score Management
save_high_score()
Saves a new high score if it beats the current record.Minigame identifier:
"memorice", "turtle_runner", "worm_catch", "food_catch", "counting_animals", or "nyuron_color"Score to save
true if new score beats the old record, false otherwiseget_high_score()
Retrieves the current high score for a minigame.Minigame identifier
High score for the game, or
0 if game not foundget_all_scores()
Returns a dictionary containing all high scores.Dictionary with game names as keys and high scores as values
Persistence Methods
load_high_scores()
Loads all player data from disk. Called automatically in_ready().
No return value
save_to_file()
Writes all current data to disk. Called automatically by methods that modify data.No return value