add start of ship controls
This commit is contained in:
parent
1027d980c1
commit
fcfe1e8790
10 changed files with 131 additions and 2 deletions
|
@ -17,6 +17,14 @@ class Player {
|
|||
this.room.remove(this);
|
||||
}
|
||||
|
||||
move(data) {
|
||||
this.ship.move({
|
||||
forward: data.forward || 0,
|
||||
left: data.left || 0,
|
||||
right: data.right || 0
|
||||
});
|
||||
}
|
||||
|
||||
sendUpdate() {
|
||||
if (Object.keys(this.delta).length == 0) return;
|
||||
this.connection.send('update', this.delta);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue