-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuake.java
More file actions
31 lines (27 loc) · 789 Bytes
/
Quake.java
File metadata and controls
31 lines (27 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import processing.core.PImage;
import java.util.List;
public class Quake
extends AnimatedActor
{
private static final int QUAKE_DURATION = 1100;
private static final int QUAKE_STEPS = 10;
public Quake(String name, Point position, int animation_rate,
List<PImage> imgs)
{
super(name, position, QUAKE_DURATION, animation_rate, imgs);
}
public Action createAction(WorldModel world, ImageStore imageStore)
{
Action[] action = { null };
action[0] = ticks -> {
removePendingAction(action[0]);
remove(world);
};
return action[0];
}
protected void scheduleAnimation(WorldModel world)
{
Actor.scheduleAction(world, this,
createAnimationAction(world, QUAKE_STEPS), getAnimationRate());
}
}