Example #1
0
 public NaveActor(Stage stage) {
   super(stage);
   texture = new TextureRegion(AlienChase.MANAGER.get("images/nave.png", Texture.class), 79, 79);
   setSize(texture.getRegionWidth(), texture.getRegionHeight());
   health = 1;
   bala = "balaNave";
   municionMax = 10;
   municion = municionMax;
   puntuacion = 0;
 }
Example #2
0
  private void fire() {
    municion--;
    BulletActor bullet = new BulletActor(stage, this, 250);
    float x = getX() - 8 + getWidth() / 2;
    float y = getY() + getHeight() - 10;

    bullet.setPosition(x, y);
    stage.addActor(bullet);

    bullets.add(bullet);
    if (GameplayScreen.isSonidoEfectos())
      AlienChase.MANAGER.get("sound/shoot.ogg", Sound.class).play();
  }