-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCutscene.java
More file actions
46 lines (36 loc) · 1015 Bytes
/
Cutscene.java
File metadata and controls
46 lines (36 loc) · 1015 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.awt.Graphics2D;
public abstract class Cutscene {
protected GamePanel panel;
protected SoundManager soundManager;
protected TileMap tileMap;
protected int currentState;
protected int frameCount;
protected boolean isPlaying;
protected boolean isDone;
public Cutscene(GamePanel panel, TileMap tileMap) {
this.panel = panel;
this.tileMap = tileMap;
this.soundManager = SoundManager.getInstance();
this.isPlaying = false;
this.isDone = false;
this.frameCount = 0;
this.currentState = 0;
}
public void start() {
reset();
isPlaying = true;
}
public void skip() {
isPlaying = false;
isDone = true;
}
public boolean isPlaying() {
return isPlaying;
}
public boolean isDone() {
return isDone;
}
protected abstract void reset();
public abstract void update();
public abstract void draw(Graphics2D g2);
}