-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAnimations.java
47 lines (32 loc) · 1.44 KB
/
Animations.java
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
47
package org.academniadecodigo.dancedance.gameobjects;
import org.academiadecodigo.simplegraphics.pictures.Picture;
import org.academniadecodigo.dancedance.simplegfx.StageSgfx;
/**
* Created by codecadet on 23/10/16.
*/
public class Animations {
private Picture startFirstFrame = new Picture(StageSgfx.PADDING, StageSgfx.PADDING, "resources/art/START_ANIMATION/START_ANIMATION_0.png");
private Picture endFirstFrame = new Picture(StageSgfx.PADDING, StageSgfx.PADDING, "resources/art/3D Character Movements/YOU_LOSE/YOU_LOSE_0.png");
public void startAnimation() throws InterruptedException { // TODO por adaptar às animacoes
startFirstFrame.draw();
for (int i = 0; i < 152; i++) {
Thread.sleep(StageSgfx.ANIMATION_SLEEP);
startFirstFrame.load("resources/art/START_ANIMATION/START_ANIMATION_"+i+".png");
}
startFirstFrame.delete();
}
public void hideStartAnimation() {
startFirstFrame.delete();
}
public void youLoseAnimation() throws InterruptedException {
endFirstFrame.draw();
for (int i = 0; i < 79; i++) {
Thread.sleep(StageSgfx.ANIMATION_SLEEP);
endFirstFrame.load("resources/art/3D Character Movements/YOU_LOSE/YOU_LOSE_" + i + ".png");
}
endFirstFrame.load("resources/art/START_ANIMATION/START_ANIMATION_150.png");
}
public void hideLoseAnimation() {
endFirstFrame.delete();
}
}