forked from osgcc/osgcc4-AsciiAsciiRevolution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AAR.d
84 lines (64 loc) · 1.55 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
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;
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();
keypad(win, true);
Thread.sleep(5);
AnimatedAsciiSprite narwhal = new AnimatedAsciiSprite("graphics/man-moonwalk.txt", win, true, true, 16, 9);
AsciiSprite light = new AsciiSprite("graphics/spotlight.txt", win, false, 0, 5);
sc = new SoundClip("music/ID__Baobinga_-_10_-_Raise_Riddim.mp3");
sc.start();
if(!levelInput(selectS, win)){endwin();}
sc.stop();
currentLevel = selectS._levels[selectS._selectedLevel];
levelS = new LevelScreen(currentLevel._name);
Shitz shitzShitty = new Shitz(levelS, win);
Thread inputThread = new Thread(&shitzShitty.callMyShit);
inputThread.start();
drawLevelScreen();
endwin();
}
void drawLevelScreen() {
clear();
sc = new SoundClip("music/" ~ currentLevel._audio);
sc.start();
while(levelS._playing){
clear();
levelS.draw();
//Thread.sleep(0.05);
Thread.sleep(levelS._arrowSect.sleep);
refresh();
}
sc.stop();
}