add ship rendering and damping

This commit is contained in:
Asraelite 2016-03-22 13:18:43 +00:00
parent 05ad81ed8d
commit 80bd84230d
22 changed files with 66 additions and 6 deletions

View file

@ -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) {

View file

@ -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];