new draw and update cycle
This commit is contained in:
@@ -18,6 +18,17 @@ class Selectable {
|
||||
}
|
||||
}
|
||||
|
||||
class KeyListener {
|
||||
key;
|
||||
execute() {
|
||||
|
||||
}
|
||||
executeOnKey(event_key) {
|
||||
if(event_key == this.key) {
|
||||
this.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Screen {
|
||||
elements = [];
|
||||
@@ -69,8 +80,6 @@ class Screen {
|
||||
}
|
||||
|
||||
keypress(event) {
|
||||
console.log(event);
|
||||
|
||||
if(this.user_can_select == true) {
|
||||
this.select_key_event(event.key);
|
||||
|
||||
@@ -184,10 +193,7 @@ class MainMenu extends Screen{
|
||||
}
|
||||
|
||||
load() {
|
||||
requestAnimationFrame(this.onFrame);
|
||||
document.addEventListener("keypress" , e => { this.keypress(e)});
|
||||
this.user_can_select = true;
|
||||
console.log(this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user