Beispiel #1
0
 public void setRandImage() {
   int i = (int) (Math.random() * 100);
   if (i < 20) {
     // grass & flowers
     super.setImage("../images/db_field_floor.png");
   } else if (i >= 20 && i < 60) {
     // empty floor
     super.setImage("../images/db_field_floor2.png");
   } else if (i >= 60)
     // grass
     super.setImage("../images/db_field_floor3.png");
 }
Beispiel #2
0
 public void setItem(Item item) {
   super.setItem(item);
   if (item == null) {
     if (C.funny == true) {
       super.setImage(C.FUNNYPILL_EXPLODED);
     } else {
       super.setImage(C.FLOORFIELD_DEFAULT_PIC);
     }
   }
   if (item instanceof Bomb) {
     if (C.funny == true) {
       super.setImage(C.FUNNYPILL_BOMB);
     } else {
       super.setImage("../images/db_field_floorbomb.png");
     }
   }
   if (item instanceof FunnyPill) {
     super.setImage(C.FUNNPILL_DEFAULT_ITEM);
   }
   if (item instanceof Teleporter) {
     super.setImage("../images/db_field_teleporter.png");
   }
   if (item instanceof Exit) {
     super.setImage(C.EXITFIELD_DEFAULT_PIC);
   }
 }