Browse Source

added arrow key support

master
mort 8 years ago
parent
commit
5298984331
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      es/game.js

+ 5
- 1
es/game.js View File

@@ -424,12 +424,17 @@ export default class Game {

this.keymap = [];
this.keymap[87] = "up";
this.keymap[38] = "up";
this.keymap[83] = "down";
this.keymap[40] = "down";
this.keymap[65] = "left";
this.keymap[37] = "left";
this.keymap[68] = "right";
this.keymap[39] = "right";
this.keymap[32] = "shoot";
this.keymap[16] = "sprint";


this.entities = [];
this.animations = [];

@@ -456,7 +461,6 @@ export default class Game {
});

sock.on("despawn", (msg) => {
console.log(msg);
if (!this.entities[msg.id])
return;


Loading…
Cancel
Save