Options
All
  • Public
  • Public/Protected
  • All
Menu

interface game Renderer

It need to contains at least the method : "setupRendering"

Note that the renderer shoud in no circumstances modify the game state in order to ensure replayability

Summary

Properties

Properties

Optional render

render: function

This optional method will be called every frame

While you can use the input here, it should not affect the game logic

Type declaration

    • (game: Game, input: Input, elapsed: number): void
    • Parameters

      Returns void

setupRendering

setupRendering: function

This method will be called before the game start and allow you to setup the rendering with the provided canvas

If not using the render method you can set a loop yourself

Type declaration

    • (game: Game, canvas: HTMLCanvasElement, timeline: Timeline): void
    • Parameters

      Returns void