Menu

SCRIPT_Singleton_PlayerData

Benedict Jäggi

Script: Singletons/PlayerData.gd

Some variables and functions which are used globally over all levels.

var actual_lifes

How many lifes the player has left.

var is_active

Player is active and not death.

var is_big

Player is grown or not.

var map_pos_id

On which MapNavNode is the player on the main map.
It's the nodes ID.

var actual_map_node

The MapNavNode the player is on.
It's the node entity itself.

var actual_stars

The star counter.

var collected_stars

A dictionary which determines if a star is already collected.

var actual_coins

The coin counter.
If the player has 100 coins, actual_lifes is plus one and actual_coins is set to 0.

func addCoin()

Adds one coin to the coin cointer. Resets it and adds one life if it reaches 100.

func addStar()

Adds one star to the star counter.

func starAlreadyCollected()

Returns if a star is already collected or not.

Back to [Scripts]


Related

Wiki: Scripts

MongoDB Logo MongoDB