-
Notifications
You must be signed in to change notification settings - Fork 0
/
endscene.pde
91 lines (72 loc) · 1.87 KB
/
endscene.pde
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class EndScene implements IScene{
SceneManager m_director;
ControlP5 m_controlGUI;
ParticleSystem m_particleSystem;
Tween m_textTween;
String m_text;
EndScene(SceneManager director, PApplet app){
if (director != null){
m_director = director;
}
if(app != null){
m_controlGUI = new ControlP5(app);
}
}
void onInit(){
m_controlGUI.addButton("Menu")
.plugTo(this)
.setPosition(width*0.70,height*0.9)
.setSize(int(width * 0.1),int(height * 0.083))
.setColorBackground(color(255,255,0,0))
.setColorActive(color(255,255,0,0))
.getCaptionLabel()
.setFont(new ControlFont(g_gameFont,int(9*g_scaleFactorX)));
m_controlGUI.addButton("Exit")
.plugTo(this)
.setPosition(width*0.80,height*0.9)
.setSize(int(width * 0.1),int(height * 0.083))
.setColorBackground(color(255,255,0,0))
.setColorActive(color(255,255,0,0))
.getCaptionLabel()
.setFont(new ControlFont(g_gameFont,int(9*g_scaleFactorX)));
m_particleSystem = new ParticleSystem();
m_text = "Congratulation, you have beaten MAMI this semester";
m_textTween = new Tween(5.0,-int(textWidth(m_text)/2), int(width/2));
}
void onPause(){
}
void onResume(){
}
void onExit(){
}
void Exit(){
exit();
}
void Menu(){
m_director.changeScene(0);
m_controlGUI.getController("Menu").hide();
m_controlGUI.getController("Exit").hide();
}
void handleInput(int k){
}
void update(float dt){
m_particleSystem.update(dt);
m_textTween.update(dt);
}
void lateUpdate(float dt){
}
void draw(){
background(0);
m_particleSystem.draw();
fill(255,255,255);
text(m_text,m_textTween.getPosition(),height/2);
}
void lateDraw(){
}
void run(float dt){
update(dt);
lateUpdate(dt);
draw();
lateDraw();
}
}