Constructor
new StatusBarCoin()
Constructs the StatusBarCoin, loads its images, sets its initial position and size,
and initializes the coin percentage to 0.
Members
IMAGES :Array.<string>
An array of image paths representing different coin collection levels.
Type:
- Array.<string>
percentage :number
The current coin collection percentage (from 0 to 5).
Type:
- number
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. |