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. |
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. |
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. |
checkGameOver()
Checks if the game is over based on the character's energy and displays the game over screen.
checkVictory()
Checks if the enemy boss is dead and, if so, displays the victory screen.
clearCanvas()
Clears the entire canvas.
draw()
Draws the entire game scene including UI, level, start screen, and game over conditions.
drawGameLevel()
Draws the game level and adjusts the view.
drawGameOver()
Draws the game over screen.
drawLevel()
Draws the game level, including background objects, collectibles, enemies, and the character.
drawMobileMovement()
Draws mobile movement controls if the game runs on a small screen.
drawStartObject()
Draws the start screen objects.
drawStartScreen()
Draws the start screen elements.
drawStatusbar()
Draws status bars for health, bottles, and coins.
drawUIElements()
Draws UI elements such as mute icons, mobile controls, and an imprint if necessary.
flipImage(mo)
Flips a map object's image horizontally.
Parameters:
| Name | Type | Description |
|---|---|---|
mo |
Object | The map object whose image will be flipped. |
scheduleNextFrame()
Schedules the next animation frame and starts background sound if the game is active.