Skip to content

Commit

Permalink
GameObjectShip: removed mock weapon handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gheja committed Aug 13, 2018
1 parent de51628 commit 720190a
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions src/game_object_ship.js
Expand Up @@ -117,72 +117,6 @@ class GameObjectShip extends GameObject

_game.objects.push(new GameObjectProjectile(b));
}

return;

a = 0;
weapon = 3;

this.shootNumber++;

if (this.enemy)
{
b = -1;
}
else
{
b = 1;
}

if (weapon == 1)
{
this.shootTicksLeft = 9;
this.power -= 0.2;

_game.objects.push(new GameObjectProjectile({ screenX: this.screenX + a, screenY: this.screenY + (-7) * b, speedX: 0, speedY: (-2) * b, hitCheckGroup: this.hitCheckGroup, gfxObjectName: "cannon_projectile1" }));
}
else if (weapon == 2)
{
this.shootTicksLeft = 4;
this.power -= 0.1;

switch (this.shootNumber % 8)
{
case 0:
case 4:
a = 0;
break;

case 1:
case 3:
a = -1;
break;

case 2:
a = -2;
break;

case 5:
case 7:
a = +1;
break;

case 6:
a = +2;
break;
}

_game.objects.push(new GameObjectProjectile({ screenX: this.screenX + a, screenY: this.screenY + (-7) * b, speedX: 0, speedY: (-2) * b, hitCheckGroup: this.hitCheckGroup, gfxObjectName: "cannon_projectile2" }));
}
else
{
this.shootTicksLeft = 10;
this.power -= 0.3;

_game.objects.push(new GameObjectProjectile({ screenX: this.screenX, screenY: this.screenY + (-7) * b, speedX: 0, speedY: (-1) * b, hitCheckGroup: this.hitCheckGroup, gfxObjectName: "cannon_projectile3" }));
_game.objects.push(new GameObjectProjectile({ screenX: this.screenX, screenY: this.screenY + (-5) * b, speedX: -1 / 4, speedY: (-1) * b, hitCheckGroup: this.hitCheckGroup, gfxObjectName: "cannon_projectile3" }));
_game.objects.push(new GameObjectProjectile({ screenX: this.screenX, screenY: this.screenY + (-5) * b, speedX: 1 / 4, speedY: (-1) * b, hitCheckGroup: this.hitCheckGroup, gfxObjectName: "cannon_projectile3" }));
}
}

rechargeTick()
Expand Down

0 comments on commit 720190a

Please sign in to comment.