Skip to content

Instantly share code, notes, and snippets.

@phunni
Created September 27, 2016 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phunni/63fed97a2223a9d5b5832a5e865e4559 to your computer and use it in GitHub Desktop.
Save phunni/63fed97a2223a9d5b5832a5e865e4559 to your computer and use it in GitHub Desktop.
public void shootPlayerLaser() {
if (!gameOver && !showingWaveNumber) {
Laser laser = laserPool.obtain();
laser.init("blue", playerShip.getPosition(), new Vector2(0, 15));
lasers.add(laser);
playerPew.play();
}
}
private void shootEnemyLaser(EnemyShip ship) {
if (!ship.isFalling()) {
Laser laser = laserPool.obtain();
laser.init("green", ship.getCentre(), new Vector2(0, -9));
lasers.add(laser);
enemyPew.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment