pnj
This commit is contained in:
parent
b7e546c67f
commit
565f6d4c19
2 changed files with 2 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
let dt = 1.;
|
let dt = 0;
|
||||||
let currentTime = new Date();
|
let currentTime = new Date();
|
||||||
function game() {
|
function game() {
|
||||||
if(player==null)
|
if(player==null)
|
||||||
|
|
|
@ -32,9 +32,7 @@ class Input {
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("keydown", (e)=>{
|
window.addEventListener("keydown", (e)=>{
|
||||||
if(["Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(e.code) > -1) {
|
e.preventDefault(); //blocks the action of the key (cf. Killian)
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
this.keysDown.add(e.key.toLowerCase())
|
this.keysDown.add(e.key.toLowerCase())
|
||||||
this.updateDir();
|
this.updateDir();
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue