Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import info.gridworld.actor.Flower;
- public class WiltingFlower extends Flower {
- private int lifeSpan;
- int age = 0;
- public WiltingFlower(int l) {
- lifeSpan = l;
- }
- public void act() {
- age++;
- if (age > lifeSpan) {
- removeSelfFromGrid();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement