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 32 33 34 35 36 | 6x 6x 6x 8x 1x 22x 22x 22x 22x 22x 22x 2x | import { Color } from "jga-games-colors";
import { DisplayInterface } from "jga-games-display";
import { Engine } from "jga-games-engine";
import { Screen } from "jga-games-screens";
export class WinScreen extends Screen {
public constructor(engine: Engine) {
super("Win", engine);
}
public render(display: DisplayInterface): void {
// Render our prompt to the screen
for (let i = 0; i < 22; i++) {
// Generate random background colors
const r = Math.round(Math.random() * 255);
const g = Math.round(Math.random() * 255);
const b = Math.round(Math.random() * 255);
const color = new Color(r, g, b);
const background = color.toRGB();
display.drawText(
{ x: 2, y: i + 1 },
"%b{" + background + "}You win!",
);
}
}
public handleInput(): string | null {
return null;
}
}
|