Skip to content

Commit

Permalink
Arrow files are read from the levels file.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Oct 24, 2010
1 parent 84e5ca5 commit 3f2f996
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion AAR.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void main(){
sc.stop();

currentLevel = selectS._levels[selectS._selectedLevel];
levelS = new LevelScreen(currentLevel._name);
levelS = new LevelScreen(currentLevel);

Shitz shitzShitty = new Shitz(levelS, win);
Thread inputThread = new Thread(&shitzShitty.callMyShit);
Expand Down
4 changes: 2 additions & 2 deletions arrowSection.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ArrowSection {

TextFileInput chartFile;

this() {
chartFile = new TextFileInput("arrow_charts/" ~ "anamanaguchi_flora_fauna" ~ ".txt");
this(char[] arrowFile) {
chartFile = new TextFileInput("arrow_charts/" ~ arrowFile);

auto bpm = chartFile.next;

Expand Down
6 changes: 4 additions & 2 deletions level.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ module level;
class Level {
char[] _audio;
char[] _name;
char[] _arrowChart;
int _difficulty;

this(char[] audio, char[] name, int difficulty) {
this(char[] audio, char[] name, int difficulty, char[] arrowChart) {
_audio = audio;
_name = name;
_difficulty = difficulty;
_difficulty = difficulty;
_arrowChart = arrowChart;
}

char[] getAudio() {
Expand Down
7 changes: 4 additions & 3 deletions levelScreen.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import tango.stdc.stringz;
import ncurses;
import tango.io.Stdout;

import level;
import dataScore;
import arrowSection;
import dancingMan;
Expand All @@ -19,9 +20,9 @@ class LevelScreen {

bool _playing;

this(char[] title) {
_score = new DataScore(title);
_arrowSect = new ArrowSection();
this(Level currentLevel) {
_score = new DataScore(currentLevel._name);
_arrowSect = new ArrowSection(currentLevel._arrowChart);
_dancingMan = new DancingMan();
_playing = true;
_spotlight = new AsciiSprite("graphics/spotlight.txt", null, false, 10, 18);
Expand Down
5 changes: 5 additions & 0 deletions levels.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
Anamanaguchi_-_02_-_Helix_Nebula.mp3
Helix Nebula by Anamanaguchi
5
anamanaguchi_flora_fauna.txt
Anamanaguchi_-_03_-_Airbase.mp3
Airbase by Anamanaguchi
5
anamanaguchi_flora_fauna.txt
Anamanaguchi_-_04_-_Video_Challenge.mp3
Video Challenge by Anamanaguchi
5
anamanaguchi_flora_fauna.txt
Anamanaguchi_-_06_-_FloraFauna.mp3
FloraFauna
5
anamanaguchi_flora_fauna.txt
Anamanaguchi_-_07_-_Power_Supply.mp3
Power Supply
5
anamanaguchi_flora_fauna.txt
6 changes: 5 additions & 1 deletion selectScreen.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SelectScreen {

char[] audio;
char[] name;
char[] arrowChart;
int difficulty = -1;

int i = 0;
Expand All @@ -34,8 +35,11 @@ class SelectScreen {
i++;
} else if(i == 2) {
difficulty = to!(int)(line);
i++;
} else if(i == 3) {
arrowChart = line;
i = 0;
Level l = new Level(audio, name, difficulty);
Level l = new Level(audio, name, difficulty, arrowChart);
_levels ~= l;
} else {
// boo!
Expand Down

0 comments on commit 3f2f996

Please sign in to comment.