Advertisement
fiveriverflow

WiltingFlower

Nov 29th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. import info.gridworld.actor.Flower;
  2.  
  3. public class WiltingFlower extends Flower {
  4.    
  5.     private int lifeSpan;
  6.     int age = 0;
  7.    
  8.     public WiltingFlower(int l) {
  9.         lifeSpan = l;
  10.     }
  11.    
  12.     public void act() {
  13.         age++;
  14.         if (age > lifeSpan) {
  15.             removeSelfFromGrid();
  16.         }
  17.     }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement