Package net.mdked.Jrachgame.world

Examples of net.mdked.Jrachgame.world.Missile


      }

      //soind?
      if (!playerC.dead && !playerC.dyin && playerC.attacking && playerC.weaponWld == 2 && spearAttack.getFrame() == 2 && playerC.shotdone) {
        playerC.shotdone = false;
        Missile spear = new Missile();
        spear.rot = (float)Math.atan2((playerC.y-mouz.y), (playerC.x-mouz.x)) ;
        spear.x = playerC.x;
        spear.y = playerC.y;
        spear.host = playerC;
View Full Code Here


      obj1r = ms.getBounds();
    }

    if (obj instanceof Missile) {
      misile = true;
      Missile mis = (Missile) obj;
      inittr = mis;
      obj1r = mis.getBounds();
    }


    for (Entity chCol : World.objecz) {
      if ( chCol instanceof StaticObj) {
        StaticObj ob = (StaticObj) chCol;
        obj2r = ob.getBounds();
        if (ismouse) {
          statObj = true;
        }
        if (misile) {
          tgt = chCol;
        }
      }
      if ( chCol instanceof Animal && !chCol.equals(obj) && !player) {
        animal = true;
        Animal an = (Animal) chCol;
        if (!an.dead) {
          obj2r = an.getBounds();

          if (misile || ismouse) {
            tgt = chCol;
          }
        }
      }
      if ( chCol instanceof Missile) {
        Missile an = (Missile) chCol;
        if (an.stuck && !anical) {
          misileget = true;
          obj2r = an.getBounds();
        }

      }
      if (obj1r.intersects(obj2r)) {

        if (misile) {
          Missile mis = (Missile) inittr;
          if (!mis.stuck && animal) {
            //System.out.println("olen ranen");
            Animal an = (Animal) tgt;
            tgt = an;

            mis.stuck = true;
            //            kopie
            playSound(5,getDRX(an.x),getDRY(an.y));

            an.criticalWound = true;
            an.hp -= 50;
            an.attacked(mis.host);
            switch (an.type) {
            case 0:
              playSound(9,getDRX(an.x),getDRY(an.y));
              break;
            case 1:
              playSound(13,getDRX(an.x),getDRY(an.y));
              break;
            }
            //System.out.println(" olens hp = " + an.hp);
          }
          else if (!mis.stuck && !player && !misileget) {
            Missile misa = (Missile) inittr;
            misa.stuck = true;
          }
          else if ( misileget ) return false;
        }
        if (ismouse && playerC.attacking) {
View Full Code Here

          else  bear.draw(wtdX - (16*xScale), wtdY-(32*xScale), xScale);

        }
      }
      if ( obj instanceof Missile ) {
        Missile misl = (Missile) obj;
        if (misl.rot < Math.toRadians(90) && misl.rot > Math.toRadians(-90)) {
          if (!misl.stuck) spearFly.draw((wtdX-16*xScale)+(32*xScale), wtdY-(32*xScale), -32*xScale ,32*xScale);
          else spearGrnd.draw((wtdX-16*xScale)+(32*xScale), wtdY-(32*xScale), -32*xScale ,32*xScale);
        }
        else {
View Full Code Here

TOP

Related Classes of net.mdked.Jrachgame.world.Missile

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.