Package com.ackgaming.entity.blocks

Examples of com.ackgaming.entity.blocks.SecondBlock


      for(int i=0; i<blocks.size(); i++) {
        if(blocks.get(i) instanceof BasicBlock) {
          BasicBlock b = (BasicBlock) blocks.get(i);
            b.draw();
        } else if(blocks.get(i) instanceof SecondBlock) {
          SecondBlock b = (SecondBlock) blocks.get(i);
          b.draw();
        } else if(blocks.get(i) instanceof ThirdBlock) {
          ThirdBlock b = (ThirdBlock) blocks.get(i);
        b.draw();
        } else if(blocks.get(i) instanceof BonusLifeBlock) {
          BonusLifeBlock b = (BonusLifeBlock) blocks.get(i);
        b.draw();
        }
      }
    }
View Full Code Here


                  blocks.remove(i);
                  b.setDestroyed();
                  b.setVisible(false);
          }
        } else if(blocks.get(i) instanceof SecondBlock){
          SecondBlock b = (SecondBlock) blocks.get(i);
         
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  b.setImage(basicBlockImg);
                  if(b.timesHit == 2) {
                    score += 15;
                    blocks.remove(i);
                    b.setDestroyed();
                    b.setVisible(false);
                  } else score += 5;
          }
        } else if(blocks.get(i) instanceof ThirdBlock) {
          ThirdBlock b = (ThirdBlock) blocks.get(i);
         
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  if(b.timesHit == 1){
                    b.setImage(secondBlockImg);
                    score += 5;
                  } else if(b.timesHit == 2) {
                    b.setImage(basicBlockImg);
                    score += 5;
                  } else if(b.timesHit == 3) {
                    score += 20;
                    b.setDestroyed();
                    b.setVisible(false);
                    blocks.remove(i);
                  }
          }
        } else if(blocks.get(i) instanceof BonusLifeBlock) {
          BonusLifeBlock b = (BonusLifeBlock) blocks.get(i);
          int blockX = (int) b.getRect().getMinX();
          int blockY = (int) b.getRect().getMaxY();
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  b.setImage(bonusLifeBlockDamImg);
                  if(b.timesHit == 2) {
                    //lives++;
                    blocks.remove(i);
                    b.setDestroyed();
                    b.setVisible(false);
                    drops.add(new BonusLifeItem(bonusLifeItemImg, blockX, blockY));
                  } else score += 10;
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.ackgaming.entity.blocks.SecondBlock

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.