36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import {D} from "./engine/public.ts";
|
|
import {Point, Size} from "./engine/datatypes.ts";
|
|
import {FG_BOLD, FG_TEXT} from "./colors.ts";
|
|
import {ALL_STATS} from "./datatypes.ts";
|
|
import {getPlayerProgress} from "./playerprogress.ts";
|
|
|
|
export class Hud {
|
|
get size(): Size {
|
|
return new Size(96, 160)
|
|
}
|
|
|
|
update() { }
|
|
|
|
draw() {
|
|
// D.fillRect(new Point(-4, -4), this.size.add(new Size(8, 8)), BG_INSET)
|
|
D.drawText("Pyrex", new Point(0, 0), FG_BOLD)
|
|
D.drawText("Level 1", new Point(0, 16), FG_TEXT)
|
|
|
|
let y = 48;
|
|
let prog = getPlayerProgress();
|
|
for (let s of ALL_STATS.values()) {
|
|
D.drawText(`${s}`, new Point(0, y), FG_BOLD)
|
|
D.drawText(`${prog.getStat(s)}`, new Point(32, y), FG_TEXT)
|
|
y += 16;
|
|
}
|
|
D.drawText("EXP", new Point(0, 128), FG_BOLD);
|
|
D.drawText("0", new Point(32, 128), FG_TEXT);
|
|
D.drawText("BLD", new Point(0, 144), FG_BOLD);
|
|
D.drawText(`${prog.getBlood()}cc`, new Point(32, 144), FG_TEXT);
|
|
}
|
|
}
|
|
|
|
let active = new Hud();
|
|
export function getHud(): Hud {
|
|
return active;
|
|
} |