Class: Level

Level(enemies, bosses, clouds, backgroundObjects, collectibleObjects, obstacles)

Level Represents a game level containing all environment elements, enemies, collectibles and layout data. Used by the World class to structure and render the current game state.

Constructor

new Level(enemies, bosses, clouds, backgroundObjects, collectibleObjects, obstacles)

Creates a new Level instance with the specified content.
Parameters:
Name Type Description
enemies Array.<MovableObject> All regular enemies in the level.
bosses Array.<MovableObject> Endbosses to fight at the end of the level.
clouds Array.<Cloud> Clouds to animate in the background.
backgroundObjects Array.<BackgroundObject> Non-interactive background visuals.
collectibleObjects Array.<CollectibleObject> Items the player can pick up.
obstacles Array.<Obstacle> Static objects that block or hurt the player.
Source:

Members

backgroundObjects :Array.<BackgroundObject>

All static background layers (e.g. hills, sky, trees). Rendered in parallax and not interactive.
Type:
Source:

bosses :Array.<MovableObject>

Endboss instances (typically one per level). Special enemies with more health and unique behavior.
Type:
Source:

clouds :Array.<Cloud>

Cloud objects that move independently across the level. Used for visual depth (parallax effect).
Type:
Source:

collectibleObjects :Array.<CollectibleObject>

All items that can be collected by the player (e.g. coins, bottles).
Type:
Source:

enemies :Array.<MovableObject>

Standard enemies (e.g. chickens, chonks). Used for interactions and collisions with the player.
Type:
Source:

level_end_x :number

X-coordinate where the level ends and the win condition is triggered.
Type:
  • number
Source:

obstacles :Array.<Obstacle>

Static obstacles like spikes or cliffs that block or damage the player.
Type:
Source: