Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 13x 13x 13x 18x 6x 6x 3x 3x 1x 3x | import { DisplayInterface } from "jga-games-display";
import { Engine, InputDataInterface, Keys } from "../index";
import { Screen } from "./screen";
export class StartScreen extends Screen {
public constructor(engine: Engine) {
super("Start", engine);
}
public render(display: DisplayInterface): void {
// Render our prompt to the screen
display.drawText({ x: 1, y: 1 }, "%c{yellow}Space Roguelike");
display.drawText({ x: 1, y: 2 }, "Press [Enter] to start!");
}
public handleInput(
inputType: string,
inputData: InputDataInterface,
): string | null {
let result = null;
// When [Enter] is pressed, go to the play screen
if (inputType === "keydown" && inputData.keyCode === Keys.RETURN) {
result = "play";
}
return result;
}
}
|