Package org.sfsoft.jfighter2dx.effects

Examples of org.sfsoft.jfighter2dx.effects.Explosion


   * Actualiza el estado de las explosiones en pantalla
   * @param dt
   */
  private void updateExplosions(float dt) {
   
    Explosion explosion = null;
   
    for (int i = explosions.size - 1; i >= 0; i--) {
     
      explosion = explosions.get(i);
      explosion.update(dt);
      if (explosion.mustDie()) {
        explosions.removeIndex(i);
      }
    }
  }
View Full Code Here


    Enemy enemy = null;
   
    for (int i = enemies.size - 1; i >= 0; i--) {
      enemy = enemies.get(i);
      if (!enemy.getClass().getSimpleName().equals("Stone")) {
        Explosion explosion = new Explosion(enemy.getX(), enemy.getY());
        explosions.add(explosion);
        if (game.configurationManager.isSoundEnabled())
          ResourceManager.getSound("explosion").play();
        enemies.removeIndex(i);
       
View Full Code Here

           
            enemy.hit();
            if (enemy.getLives() == 0) {
              ship.addScore(enemy.getValue());
             
              Explosion explosion = new Explosion(enemy.getX() - Constants.ENEMY_WIDTH, enemy.getY());
              explosions.add(explosion);
              enemies.removeIndex(i);
             
              if (game.configurationManager.isSoundEnabled())
                ResourceManager.getSound("explosion").play();
            }
           
          }
          // Si se dispara contra la bala de un enemigo, el proyectil no desaparece
          // Si se dispara un misil, éste tampoco desaparece hasta que no llega al final de la pantalla,
          // aunque haya acertado a algún enemigo
          if ((!enemy.getClass().getSimpleName().equals("ShooterBullet")) &&
              (!bullet.getClass().getSimpleName().equals("Missile")))
            bullets.remove(j);
        }
      }
    }
   
    // Comprueba si la nave colisiona con algún enemigo
    if (ship.getShieldTime() <= 0) {
      for (int i = enemies.size - 1; i >= 0; i--) {
        enemy = enemies.get(i);
       
        if (enemy.getRect().overlaps(ship.getRect())) {
         
          enemy.hit();
          if (enemy.getLives() == 0) {
            ship.addScore(enemy.getValue());
           
            Explosion explosion = new Explosion(enemy.getX(), enemy.getY());
            explosions.add(explosion);
            enemies.removeIndex(i);
           
            if (game.configurationManager.isSoundEnabled())
              ResourceManager.getSound("explosion").play();
View Full Code Here

TOP

Related Classes of org.sfsoft.jfighter2dx.effects.Explosion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.