Class: DrawableObject

DrawableObject()

Represents a drawable object in the game.

Constructor

new DrawableObject()

Source:

Methods

draw(ctx)

Draws the object on the canvas.
Parameters:
Name Type Description
ctx CanvasRenderingContext2D The rendering context of the canvas.
Source:

drawFrame(ctx)

Draws the frame of the object for debugging purposes.
Parameters:
Name Type Description
ctx CanvasRenderingContext2D The rendering context of the canvas.
Source:

loadImage(path)

Loads an image from a given path.
Parameters:
Name Type Description
path string The path to the image.
Source:

loadImages(arr)

Loads multiple images and caches them.
Parameters:
Name Type Description
arr Array.<string> The array of image paths.
Source:

playAnimation(images)

Plays an animation by cycling through an array of images.
Parameters:
Name Type Description
images Array.<string> The array of image paths.
Source: