Class: StatusBarBottle

StatusBarBottle()

Represents a status bar showing the number of bottles the player has, extending the DrawableObject class.

Constructor

new StatusBarBottle()

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

Members

IMAGES :Array.<string>

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

percentage :number

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

Methods

setPercentage(percentage)

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