add ship rendering and damping
This commit is contained in:
parent
05ad81ed8d
commit
80bd84230d
22 changed files with 66 additions and 6 deletions
|
@ -2,8 +2,11 @@ function Ship(id) {
|
|||
this.id = id;
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.r = 0;
|
||||
this.hull = '01';
|
||||
this.move = [];
|
||||
this.lastMove = [];
|
||||
this.bodyType = 'ship';
|
||||
|
||||
this.updateMove = function() {
|
||||
if (JSON.stringify(this.move) != JSON.stringify(this.lastMove) || true) {
|
||||
|
|
|
@ -3,6 +3,11 @@ function World() {
|
|||
this.playerShip = false;
|
||||
this.playerShipId = false;
|
||||
|
||||
this.clear = function() {
|
||||
this.bodies = {};
|
||||
this.playerShip = false;
|
||||
}
|
||||
|
||||
this.update = function(data) {
|
||||
this.playerShip = this.bodies[this.playerShipId];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue