|
|
@@ -66,10 +66,13 @@ function Player(game) { |
|
|
|
this.invincibleTimeout = null; |
|
|
|
this.started = false; |
|
|
|
this.rotation = 0; |
|
|
|
this.bigBox = new Box(60, 40, { x: -30, y: -20 }); |
|
|
|
this.bigBox = new Box(0, 0); |
|
|
|
this.box = new Box(); |
|
|
|
this.shape.push(this.box); |
|
|
|
|
|
|
|
this.bigShape = new Shape(this); |
|
|
|
this.bigShape.push(new Box(100, 70, { x: -50, y: -35 })); |
|
|
|
|
|
|
|
this.erectLevel = 0; |
|
|
|
this.rise(); |
|
|
|
|
|
|
@@ -139,13 +142,10 @@ Player.prototype.update = function() { |
|
|
|
if (ent === this) |
|
|
|
continue; |
|
|
|
|
|
|
|
if (!this.shape.collidesWith(ent.shape)) |
|
|
|
continue; |
|
|
|
|
|
|
|
if (ent instanceof Obstacle) { |
|
|
|
if (ent instanceof Obstacle && this.shape.collidesWith(ent.shape)) { |
|
|
|
this.lower(); |
|
|
|
return; |
|
|
|
} else if (ent instanceof PowerUp) { |
|
|
|
} else if (ent instanceof PowerUp && this.bigShape.collidesWith(ent.shape)) { |
|
|
|
this.rise(); |
|
|
|
ent.dead = true; |
|
|
|
} |