Class: Apate

Apate()

This class is the entry point of the engine. It handles the engines initialization, asynchronous content loading and executes the game loop

Constructor

new Apate()

Example
import Apate, { World } from "<apate>/index.js";

class Game extends Apate {
    sprite;

    async init() {
        // load content required for running the game
        const tile = Tile.fromImage(<img>);
        this.sprite = new World.Sprite(tile, this.scene, "My first sprite");
    }

    update() {
        // gets called every frame before the drawing is done
        sprite.transform.rotate(0, 0.1, 0);
    }
}
new Game();

Classes

Apate

Members

context :Context

The context for draw operations

renderer :Renderer

The instance of the current renderer (only webgl2 is supported for now)

scene :Obj

This is the currently active scene. The object and all children will be drawn when they are in the active scene

Methods

(async) _init()

Internal init only (do not overwrite)