-
Notifications
You must be signed in to change notification settings - Fork 6
/
AAR.d
106 lines (84 loc) · 1.69 KB
/
AAR.d
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module AAR;
import tango.io.Stdout;
import tango.core.Thread;
import ncurses;
import tango.stdc.stringz;
import asciiSprite;
import animatedAsciiSprite;
import util.soundclip;
import level;
import selectScreen;
import input;
import levelScreen;
WINDOW* win;
Level currentLevel;
SelectScreen selectS;
LevelScreen levelS;
SoundClip sc;
bool userquit = false;
bool playgame = true;
void main(){
selectS = new SelectScreen("levels.txt");
sc = new SoundClip("sounds/title.mp3");
win = initscr();
noecho();
cbreak();
start_color();
curs_set(0);
sc.start();
clear();
refresh();
AsciiSprite logo = new AsciiSprite("graphics/logo.txt", win);
logo.drawSprite();
refresh();
clear();
refresh();
logo.drawSprite();
refresh();
Thread.sleep(5);
while(1){
keypad(win, true);
sc = new SoundClip("music/ID__Baobinga_-_10_-_Raise_Riddim.mp3");
sc.start();
//clear();
//refresh();
playgame = levelInput(selectS, win);
sc.stop();
if(!playgame){
break;
}
currentLevel = selectS._levels[selectS._selectedLevel];
levelS = new LevelScreen(currentLevel);
listenforkey = true;
Shitz shitzShitty = new Shitz(levelS, win);
Thread inputThread = new Thread(&shitzShitty.callMyShit);
inputThread.start();
drawLevelScreen();
listenforkey = false;
}
endwin();
}
void drawLevelScreen() {
userquit = false;
clear();
sc = new SoundClip("music/" ~ currentLevel._audio);
sc.start();
int count = 0;
while(levelS._playing && !userquit){
clear();
if(count%2 == 0){
levelS.draw(false);
} else {
levelS.draw(true);
}
refresh();
Thread.sleep(levelS._arrowSect.sleep/10.0);
count++;
}
sc.stop();
if(!userquit){
Thread.sleep(5);
}
clear();
refresh();
}