Class: DrawibilManager

DrawibilManager(world)

Manages drawing operations within the game world.

Constructor

new DrawibilManager(world)

Creates an instance of DrawibilManager.
Parameters:
Name Type Description
world Object The game world object containing canvas, context, and game state.
Source:

Methods

addObjectsToMap(objects)

Adds multiple map objects to the canvas.
Parameters:
Name Type Description
objects Array.<Object> An array of map objects to be drawn.
Source:

addToMap(mo)

Adds a map object to the canvas and draws it. Flips the image if required.
Parameters:
Name Type Description
mo Object The map object to be drawn.
Source:

checkGameOver()

Checks if the game is over based on the character's energy and displays the game over screen.
Source:

checkVictory()

Checks if the enemy boss is dead and, if so, displays the victory screen.
Source:

clearCanvas()

Clears the entire canvas.
Source:

draw()

Draws the entire game scene including UI, level, start screen, and game over conditions.
Source:

drawGameLevel()

Draws the game level and adjusts the view.
Source:

drawGameOver()

Draws the game over screen.
Source:

drawLevel()

Draws the game level, including background objects, collectibles, enemies, and the character.
Source:

drawMobileMovement()

Draws mobile movement controls if the game runs on a small screen.
Source:

drawStartObject()

Draws the start screen objects.
Source:

drawStartScreen()

Draws the start screen elements.
Source:

drawStatusbar()

Draws status bars for health, bottles, and coins.
Source:

drawUIElements()

Draws UI elements such as mute icons, mobile controls, and an imprint if necessary.
Source:

flipImage(mo)

Flips a map object's image horizontally.
Parameters:
Name Type Description
mo Object The map object whose image will be flipped.
Source:

scheduleNextFrame()

Schedules the next animation frame and starts background sound if the game is active.
Source: