Sly 1:Game state
|Description||Manages the current state of the game world|
|Game||Sly Cooper and the Thievius Raccoonus|
Game state is the subsystem that manages the current state of the game world. It manages a global instance of the GS struct, which keeps track of things such as the quantity of keys, coins, and charms collected; unlocked powerups; which cutscenes have been watched; and more.
Startup[edit | edit source]
The startup function,
StartupGame, only calls
StartGame[edit | edit source]
UnloadGame followed by
UnloadGame[edit | edit source]
UnloadGame is called during startup and during a level transition if the ClearGame transition flag is set. It calls
RetryGame. It also disables cheat codes by setting
GRFCHT::None and it sets the stored value for the previous level ID to -1.
InitGameState[edit | edit source]
InitGameState function at 1605e8 resets fields on the global
g_gs instance to their defaults. Specifically, it sets the following values:
It then calls a function which resets the game settings to their defaults.
Update[edit | edit source]
The update function,
UpdateGameState, takes the current frame's
dt as input and updates the play times on the global
g_gs instance. Specifically, it adds the
dt value to the current game play time (
g_pgsCur->dt), the current world play time (
g_wsCur->dt), and the current level play time (
g_lsCur->dt). It does not call any other functions.
Global values[edit | edit source]
|g_pgsCur||GS*||0x2623c0||Pointer to current game state|
|g_pwsCur||WS*||0x2623c4||Pointer to current world state|
|g_plsCur||LS*||0x2623c8||Pointer to current level state|