Skip to content

Commit

Permalink
updated miss bar counter
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Oct 24, 2010
1 parent b0d40e4 commit 5128704
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 5 additions & 1 deletion dataScore.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class DataScore {
_score += value;
}

void setScore(int value) {
_score = value;
}

void draw() {
int x = 0;
int y = 0;
Expand All @@ -40,7 +44,7 @@ class DataScore {

move(y,x);

addstr(toStringz(("# Score: " ~ to!(char)(_score))));
addstr(toStringz(("# Score: " ~ to!(char[])(_score))));

move(y,59);
addch('#');
Expand Down
3 changes: 2 additions & 1 deletion levelScreen.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class LevelScreen {
}

void draw(bool fast) {
updateWarningBar(_arrowSect.misses, _arrowSect.good+g_arrowSect.great);
_score.setScore((-50*_arrowSect.misses) + (100*_arrowSect.good) + (200*_arrowSect.great));
_warningBar.updateWarningBar(_arrowSect.misses, (_arrowSect.good + _arrowSect.great));

move(0,0);
_score.draw();
Expand Down
10 changes: 5 additions & 5 deletions warningBar.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class WarningBar {
_level = 0;
}

void updateWarningBar(int misses, int succeses){
_level = _level - misses + successes;
void updateWarningBar(int misses, int successes){
_level += misses - successes;
}

void draw() {
move(127, 0);
move(0,120);

for(int i=0; i<_level; i++){
addstr("---");
move(127, i);
addstr(toStringz("---"));
move(i,120);
}
}
}

0 comments on commit 5128704

Please sign in to comment.