diff --git a/src/common/rpg/systems/render/text.ts b/src/common/rpg/systems/render/text.ts index 296fa93..d24a913 100644 --- a/src/common/rpg/systems/render/text.ts +++ b/src/common/rpg/systems/render/text.ts @@ -8,9 +8,11 @@ import { Resources } from "@common/rpg/utils/resources"; export class TextDisplaySystem extends System { public readonly display: TextDisplay; - constructor(display?: TextDisplay) { + constructor(display: TextDisplay); + constructor(width?: number, height?: number); + constructor(displayOrWidth?: TextDisplay | number, height?: number) { super(); - this.display = display ?? new TextDisplay(); + this.display = displayOrWidth instanceof TextDisplay ? displayOrWidth : new TextDisplay(displayOrWidth, height); } override update(world: World) { diff --git a/src/games/crawler/index.ts b/src/games/crawler/index.ts index 73e97c0..6c5dd8f 100644 --- a/src/games/crawler/index.ts +++ b/src/games/crawler/index.ts @@ -36,7 +36,7 @@ function createMap(world: World, random: SeededRandom) { export default gameLoop(() => { const world = new World(); - const display = world.addSystem(new TextDisplaySystem()).display; + const display = world.addSystem(new TextDisplaySystem(100, 25)).display; const random = new SeededRandom('awoorwa'); const map = createMap(world, random);