Package org.sfsoft.jfighter2dx.characters

Examples of org.sfsoft.jfighter2dx.characters.Ship


 
  public SpriteManager(JFighter2DX game) {
 
    background = ResourceManager.getTexture("background");
   
    ship = new Ship(50, 50, 250, game.configurationManager);
    ship.setLives(Constants.SHIP_LIVES);
   
    enemies = new Array<Enemy>();
    enemyBullets = new Array<Bullet>();
    explosions = new Array<Explosion>();
View Full Code Here


  /**
   * Muestra la información de juego del personaje
   */
  private void drawOnscreenText() {
   
    Ship ship = spriteManager.getShip();
 
    // Muestra la puntuación y nivel del jugador
    game.font.draw(game.batch, "PUNTOS: " + ship.getScore(), 15, 20);
    game.font.draw(game.batch, "NIVEL: " + levelManager.getCurrentLevel(), 130, 20);

    game.batch.draw(ResourceManager.getAtlas("ship").findRegion("ship", 1), 15, 30, 20, 10);
    game.font.draw(game.batch, "X " + spriteManager.getShip().getLives(), 50, 40);
   
    game.batch.draw(ResourceManager.getTexture("bomb_score"), 15, 45);
    game.font.draw(game.batch, "X " + spriteManager.getShip().getBombs(), 50, 55);
   
    game.batch.draw(ResourceManager.getTexture("missile_score"), 15, 60);
    game.font.draw(game.batch, "X " + spriteManager.getShip().getMissiles(), 50, 70);

    // Muestra el escudo protector de la nave
    shapeRenderer.begin(ShapeType.Line);
    if (ship.getShieldTime() > 3) {
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 1.5f, Constants.SHIP_WIDTH + 1f, Constants.SHIP_WIDTH + 1);
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 2f, Constants.SHIP_WIDTH + 11, Constants.SHIP_WIDTH + 11);
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 2.2f, Constants.SHIP_WIDTH + 21, Constants.SHIP_WIDTH + 21);
    }
    else if ((ship.getShieldTime() > 2) && (ship.getShieldTime() <= 3)) {
     
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 1.5f, Constants.SHIP_WIDTH + 1, Constants.SHIP_WIDTH + 1);
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 2f, Constants.SHIP_WIDTH + 11, Constants.SHIP_WIDTH + 11);
    }
    else if ((ship.getShieldTime() > 0) && (ship.getShieldTime() <= 2)) {
      shapeRenderer.ellipse(ship.getX(), ship.getY() - Constants.SHIP_HEIGHT / 1.5f, Constants.SHIP_WIDTH + 1, Constants.SHIP_WIDTH + 1);
    }
    shapeRenderer.end();
  }
View Full Code Here

TOP

Related Classes of org.sfsoft.jfighter2dx.characters.Ship

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.