new GameResetManager()
Manages resetting the game by stopping ongoing intervals,
resetting the character, enemies, clouds, collectible items, and status bars,
as well as clearing certain arrays and counters.
Members
world :Object
The game world instance that holds game elements.
Type:
- Object
Methods
resetArrayElements(array, resetMethod)
Calls a specified reset method on each element of an array, if it exists.
Parameters:
| Name | Type | Description |
|---|---|---|
array |
Array | The array of elements to reset. |
resetMethod |
string | The name of the reset method to call on each element. |
resetCharacter()
Resets the character to its default state and stops the snore sound.
resetCounts()
Resets all counts and clears the array of throwable objects.
resetGame()
Resets the entire game by stopping all intervals, resetting key entities,
status bars, counts, and store items.
resetStatusBars()
Resets all status bars to their initial values.
resetStore()
Resets the store to its default state.
stopAllIntervals()
Stops and clears all intervals stored in the world's Intervals array.