Class: StatusBarCoin

StatusBarCoin()

Represents a status bar for coins, extending the DrawableObject class.

Constructor

new StatusBarCoin()

Constructs the StatusBarCoin, loads its images, sets its initial position and size, and initializes the coin percentage to 0.
Source:

Members

IMAGES :Array.<string>

An array of image paths representing different coin collection levels.
Type:
  • Array.<string>
Source:

percentage :number

The current coin collection percentage (from 0 to 5).
Type:
  • number
Source:

Methods

setPercentage(percentage)

Sets the coin collection level and updates the status bar image accordingly. The percentage is constrained between 0 and 5.
Parameters:
Name Type Description
percentage number The new coin collection percentage.
Source: