-
Notifications
You must be signed in to change notification settings - Fork 1
Player Data
Jason edited this page Aug 18, 2025
·
4 revisions
This page presents details about what the player data needed to be stored between game sessions.
To provide correct flow of the game between stages, a separate scriptable object was made for each individual player.
All the data about the player are labeled in the table. Some values had to be serialised to store them after exiting the application, see the "Serialising Data" page for more information.
| Data type | Description | Is it saveable? |
|---|---|---|
| Defeated Enemies | A dictionary containing information about number of defeated enemies per type (an enemy type is added only if defeated at least one enemy of this type). It is reset when the next stage is started. | ❌ |
| Spawner | A reference to the spawner game object existing on the stage scene. This is to initiate respawning when the player is destroyed (if has any lives left) and checking if the player should be considered as active (due to the 2 player mode and the second player). | ❌ |
| Current Health | Current number of health points. This is for the case of gaining hit by an enemy on the 4th rank (this is the only rank which gives the player 2 health points instead of one) and prevent setting to 2 health points between stages. | ❌ |
| Is Alive | A boolean value checking if the player is still alive. This is for checking if the game is over (if all the players have this boolean set as false), deactivating player spawner connected with the player robot and for excluding counting of defeated enemies from inactive players in the score scene. | ❌ |
| Was Alive On Current Stage | A boolean value checking if the player was alive on the current stage. This is for specific case to display defeated enemies by the player who was defeated on the current stage (but only one time as an exception) and to hide appropriate UI elements in the score scene starting from the next stage. | ❌ |
| Score | Current number of gained points. | ✅ |
| Lives | Current number of lives. If the player was defeated and no lives left, then they are considered as defeated definitively (the "Is Alive" flag is set to false). | ❌ |
| Rank Number | Current number of rank. This is for setting appropriate rank to the player when the player is spawned (or respawned) or collected a bonus. | ❌ |
| Ranks | An array of data about every separate rank (it contains statistics values such as movement speed or dealt damage). | ❌ |
| Initial Lives | Number of initial lives set on the start of the game session. | ❌ |
| Max Lives | Maximum number of lives (an upper bound). | ❌ |
| Initial Rank Number | Initial number of rank set on start of the game session. | ❌ |