Starting on keyboard stuff

This commit is contained in:
dylan
2023-05-02 18:17:31 -07:00
parent fdc8f97aee
commit 253b8e9567
4 changed files with 125 additions and 3 deletions

View File

@ -3,14 +3,25 @@ import {
frame,
} from "./window.ts";
import { codeSheet } from "./sheet.ts";
import { refreshKeyboard } from "./keyboard.ts";
import { repl } from "./repl.ts";
const game = codeSheet(0);
game.init();
let mode: "play" | "edit" = "edit";
await mainloop((_t) => {
// TODO: use t
game.update();
game.draw();
frame();
if (mode === "play") {
game.update();
game.draw();
frame();
} else if (mode === "edit") {
repl.update();
repl.draw();
frame();
}
refreshKeyboard();
});