-
Notifications
You must be signed in to change notification settings - Fork 1
/
Intro.pde
63 lines (44 loc) · 1.36 KB
/
Intro.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
class Intro{
Intro(int _introCounter){
introCounter = _introCounter * 30;
introCounterBackup = _introCounter * 30;
file = new File(sketchPath() + "/data/credit.txt");
if(file.exists()){
author = loadStrings(sketchPath() + "/data/credit.txt");
credit = true;
}
}
void draw(){
background(color(0,0,255));
fill(color(255, 255, 0, map(introCounter, introCounterBackup, 120, 0, 255)));
textSize(72);
//textAlign(CENTER);
text("Music Jeopardy", width/2, height/2 - 25);
fill(color(255, 255, 0, map(introCounter, introCounterBackup - 10, 10, 0, 255)));
textSize(18);
//textAlign(CENTER);
text("By Niels Hvid", width/2, height/2 + 35);
if (credit){
fill(color(255, 255, 0, map(introCounter, introCounterBackup - 60, 60, 0, 255)));
textSize(36);
//textAlign(CENTER);
text("Music by " + author[0], width/2, height/2 + 125);
}
introCounter--;
if (introCounter <= 0){
state = state.nextState();
}
}
void click(){
if (state == Jeopardy.JeopardyState.INTRO){
if (mouseButton == RIGHT){
introCounter = 0;
}
}
}
float introCounter;
float introCounterBackup;
boolean credit = false;
File file;
String[] author;
}