Package battleTank

Examples of battleTank.Obstacle


        g.drawImage(grass, j, i, null);
      }
    }
   
    for (int i = 0; i < model.getObstacles().size(); i++) {
      Obstacle p = model.getObstacles().get(i);
      if (p instanceof SpikePit) {// for instance of SpikePit
        SpikePit sp = (SpikePit) p;
        SpikePitRectangle spRect = sp.getRectangle();
        g.drawImage(spRect.getImage(), spRect.xCoord(),
            spRect.yCoord(), null);
      }
      if (p instanceof Crate) {// for instance of crate
        Crate c = (Crate) p;
        CrateRectangle cRect = c.getRectangle();
        g.drawImage(cRect.getImage(), cRect.xCoord(), cRect.yCoord(),
            null);
       
      }
      if (p instanceof ImmovableBlock) {// for instance of immovableBlock
        ImmovableBlock ib = (ImmovableBlock) p;
        ImmovableBlockRectangle ibRect = ib.getRectangle();
        g.drawImage(ibRect.getImage(), ibRect.xCoord(),
            ibRect.yCoord(), null);
   
      }
      if(p instanceof FireRing) {
        FireRing fr = (FireRing)p;
        FireRingRectangle rect = fr.getRectangle();
        g.drawImage(fr.getImage(), rect.xCoord(),
            rect.yCoord(), null);
      }
     

      if (p instanceof TNT) {// for instance of TNT
        TNT tnt = (TNT) p;
        TNTRectangle tntRect = tnt.getRectangle();
        g.drawImage(tntRect.getImage(), tntRect.xCoord(),
            tntRect.yCoord(), null);
     
      }

    }
    for (PlayerTank p : tankList) {
      TankRectangle tRect = p.getRectangle();
      g.drawImage(p.getImage(), tRect.xCoord(), tRect.yCoord(), null);
    }
    for (EnemyTank p : enemyList) {
      TankRectangle tRect = p.getRectangle();
      g.drawImage(p.getImage(), tRect.xCoord(), tRect.yCoord(), null);
    }

    for (Projectile p : projectileList) {
      if (p instanceof PlayerProjectile) {
        PlayerProjectile s = (PlayerProjectile) p;
View Full Code Here


    playerScore = 0;
    enemyScore = 0;
    map = new Arena1();
    obstacleList = new LinkedList<Obstacle>();
    for(int j = 0; j < map.getObstacles().size(); j++) {
      Obstacle o = map.getObstacles().get(j);
      addObstacle(o);
    }
    tankList = map.getPlayers();
    itemList = map.getItems();
    explosionList = map.getExplosions();
View Full Code Here

TOP

Related Classes of battleTank.Obstacle

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.