Package fr.umlv.escapeir.model.element

Examples of fr.umlv.escapeir.model.element.AbstractShip


   
    /**
     * Test if a player bullet hit an ennemy
     */
    if(contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureB().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureA().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
   
    /**
     * Test if ennemy bullet hit the player
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
    /**
     * Test if bullet hit a boss
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
    /**
     * Test if ennemy hit the player
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      ship.isHit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      ship.isHit();
    }
   
    /**
     * Test if a boss hit the player
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      ship.isHit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      ship.isHit();
    }
  }
View Full Code Here

TOP

Related Classes of fr.umlv.escapeir.model.element.AbstractShip

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.