refactor project structure, implement tessellator

This commit is contained in:
LabyStudio
2022-01-31 20:15:27 +01:00
parent 192417f626
commit 293a6d9553
15 changed files with 160 additions and 36 deletions
+20
View File
@@ -0,0 +1,20 @@
window.Keyboard = class {
static state = {};
static create() {
window.addEventListener('keydown', function (event) {
Keyboard.state[event.code] = true;
//console.log("Key " + event.code + " down");
});
window.addEventListener('keyup', function (event) {
delete Keyboard.state[event.code];
//console.log("Key " + event.code + " up");
});
};
static isKeyDown(key) {
return Keyboard.state[key];
}
}