-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrownCow.java
More file actions
22 lines (16 loc) · 766 Bytes
/
GrownCow.java
File metadata and controls
22 lines (16 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import processing.core.PImage;
import java.util.List;
public class GrownCow extends Cow {
public GrownCow(String id, Point position, List<PImage> images, double animationPeriod, double actionPeriod, int health, int healthLimit) {
super(id, position, images, animationPeriod, actionPeriod, health, healthLimit);
}
public boolean transform(WorldModel world, EventScheduler scheduler, ImageStore imageStore) {
if (getHealth() <= 0) {
Steak steak = Factory.createSteak(WorldLoader.STEAK_KEY + "_" + getId(), getPosition(), imageStore.getImageList(WorldLoader.STEAK_KEY));
world.removeEntity(scheduler, this);
world.tryAddEntity(steak);
return true;
}
return false;
}
}