Class: CollectiblCoin

CollectiblCoin()

Represents a collectible coin in the game, extending the MovableObject class. It handles loading coin images, setting collision offsets, randomizing its position, and managing the coin's animation.

Constructor

new CollectiblCoin()

Constructs a new collectible coin, loads its images, sets collision offsets, positions it randomly within specified ranges, and starts its animation.
Source:

Members

IMAGES :Array.<string>

An array of coin images for animation.
Type:
  • Array.<string>
Source:

Methods

animate()

Starts or restarts the animation interval that cycles through the coin images. Uses the playAnimation method to move through the IMAGES array.
Source:

reset()

Resets the coin's position to a random location within a specified range and restarts its animation. Clears any existing animation interval before restarting.
Source: