Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GameObject

A game object defines an entity in your game's world.
It can be for example the player's character, a button, etc.

Hierarchy

  • GameObject

Implements

Index

Constructors

Methods

Constructors

constructor

Methods

create

  • create(): void
  • Called when the game object is created.
    You can set the game object's properties in here, use the loader to load textures, etc...

    Returns void

render

  • render(context: CanvasRenderingContext2D): void
  • Called every frame as long as the game object is in the active scene.
    Render the game object to the screen using the renderer's 2D context.

    Parameters

    • context: CanvasRenderingContext2D

      The renderer's context, automatically passed in.

    Returns void

update

  • update(): void
  • Called every frame as long as the game object is in the active scene.
    You can update your object property from here to, for example, move a character if a keyboard key is being pressed.

    Returns void

Generated using TypeDoc