add start of ship controls
This commit is contained in:
parent
1027d980c1
commit
fcfe1e8790
10 changed files with 131 additions and 2 deletions
|
@ -18,6 +18,7 @@ function Game() {
|
|||
this.connected = false;
|
||||
this.state = 'connecting';
|
||||
|
||||
this.input = new Input();
|
||||
this.net = new Net();
|
||||
this.world = new World();
|
||||
this.renderer = new Renderer();
|
||||
|
@ -25,6 +26,17 @@ function Game() {
|
|||
this.tick = function() {
|
||||
self.renderer.render(self.state);
|
||||
|
||||
var ship = self.world ? self.world.playerShip : false;
|
||||
|
||||
if(ship) {
|
||||
ship.move[0] = self.input.keys.held[87] || false;
|
||||
ship.move[1] = self.input.keys.held[65] || false;
|
||||
ship.move[2] = self.input.keys.held[68] || false;
|
||||
ship.updateMove();
|
||||
}
|
||||
|
||||
self.input.clear();
|
||||
|
||||
requestAnimationFrame(self.tick);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue