Class: GameResetManager

GameResetManager()

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.
Source:

Members

world :Object

The game world instance that holds game elements.
Type:
  • Object
Source:

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.
Source:

resetCharacter()

Resets the character to its default state and stops the snore sound.
Source:

resetCounts()

Resets all counts and clears the array of throwable objects.
Source:

resetGame()

Resets the entire game by stopping all intervals, resetting key entities, status bars, counts, and store items.
Source:

resetStatusBars()

Resets all status bars to their initial values.
Source:

resetStore()

Resets the store to its default state.
Source:

stopAllIntervals()

Stops and clears all intervals stored in the world's Intervals array.
Source:

GameResetManager(world)

new GameResetManager(world)

Creates a new GameResetManager instance.
Parameters:
Name Type Description
world Object The game world containing all game elements.
Source:

Members

world :Object

The game world instance that holds game elements.
Type:
  • Object
Source:

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.
Source:

resetCharacter()

Resets the character to its default state and stops the snore sound.
Source:

resetCounts()

Resets all counts and clears the array of throwable objects.
Source:

resetGame()

Resets the entire game by stopping all intervals, resetting key entities, status bars, counts, and store items.
Source:

resetStatusBars()

Resets all status bars to their initial values.
Source:

resetStore()

Resets the store to its default state.
Source:

stopAllIntervals()

Stops and clears all intervals stored in the world's Intervals array.
Source: