Exemplo n.º 1
0
  @Override
  public void spawn() {
    MainGame mainGame = MainGame.getInstance();
    double x, y;

    x = -10;
    y = 80;
    this.setPosition(x, y);
    this.setVelocity(0.1, 0.1);
    Player p = mainGame.getPlayer();
    double angle = Math.atan((getY() - p.getY()) / (p.getX() - getX()));
    if (p.getX() < getX()) angle -= Math.PI;
    this.setAngle(angle);
    this.setRv(0.0);
    // this.activateProjectiles();
    this.setNextShot(mainGame.getCurrentTime() + 300);
    mainGame.setNextEnemy3Delay(mainGame.getCurrentTime() + 300);

    this.setState(new ActiveShooter());
  }