Class: Level

Level()

new Level()

Represents a level in the game, containing enemies, clouds, background objects, and collectible items such as bottles and coins.
Source:

Members

backroundObjeckt :Array.<BackgroundObjekt>

Array of background objects in the level.
Type:
Source:

clouds :Array.<Cloud>

Array of clouds in the level.
Type:
  • Array.<Cloud>
Source:

collectiblBottel :Array.<CollectiblBottel>

Array of collectible bottles in the level.
Type:
Source:

collectiblCoin :Array.<CollectiblCoin>

Array of collectible coins in the level.
Type:
Source:

enemies :Array.<Enemy>

Array of enemies in the level.
Type:
  • Array.<Enemy>
Source:

initialCollectiblesBottles :Array.<CollectiblBottel>

The initial state of collectible bottles.
Type:
Source:

initialCollectiblesCoins :Array.<CollectiblCoin>

The initial state of collectible coins.
Type:
Source:

level_end_x :number

The x-coordinate representing the end of the level.
Type:
  • number
Source:

Methods

repetBackround()

Populates the background with repeated images to create a scrolling effect. It alternates between two variants for each background layer.
Source:

resetCollectibles()

Resets the collectible items (bottles and coins) to their initial state, restoring positions and statuses as needed.
Source:

Level(enemies, clouds, backroundObjeckt, collectiblBottel, collectiblCoin)

new Level(enemies, clouds, backroundObjeckt, collectiblBottel, collectiblCoin)

Creates a new Level instance, initializing arrays for enemies, clouds, background objects, and collectible items. It also stores the initial state of collectibles and populates the background.
Parameters:
Name Type Description
enemies Array.<Enemy> The enemies present in the level.
clouds Array.<Cloud> The clouds present in the level.
backroundObjeckt Array.<BackgroundObjekt> The background objects in the level.
collectiblBottel Array.<CollectiblBottel> The collectible bottles in the level.
collectiblCoin Array.<CollectiblCoin> The collectible coins in the level.
Source:

Members

backroundObjeckt :Array.<BackgroundObjekt>

Array of background objects in the level.
Type:
Source:

clouds :Array.<Cloud>

Array of clouds in the level.
Type:
  • Array.<Cloud>
Source:

collectiblBottel :Array.<CollectiblBottel>

Array of collectible bottles in the level.
Type:
Source:

collectiblCoin :Array.<CollectiblCoin>

Array of collectible coins in the level.
Type:
Source:

enemies :Array.<Enemy>

Array of enemies in the level.
Type:
  • Array.<Enemy>
Source:

initialCollectiblesBottles :Array.<CollectiblBottel>

The initial state of collectible bottles.
Type:
Source:

initialCollectiblesCoins :Array.<CollectiblCoin>

The initial state of collectible coins.
Type:
Source:

level_end_x :number

The x-coordinate representing the end of the level.
Type:
  • number
Source:

Methods

repetBackround()

Populates the background with repeated images to create a scrolling effect. It alternates between two variants for each background layer.
Source:

resetCollectibles()

Resets the collectible items (bottles and coins) to their initial state, restoring positions and statuses as needed.
Source: