Permalink
Browse files

updated miss bar counter

  • Loading branch information...
1 parent b0d40e4 commit 51287042b67b768e0f448239e23c68165d85bb12 @LindseyB LindseyB committed Oct 24, 2010
Showing with 12 additions and 7 deletions.
  1. +5 −1 dataScore.d
  2. +2 −1 levelScreen.d
  3. +5 −5 warningBar.d
View
@@ -18,6 +18,10 @@ class DataScore {
_score += value;
}
+ void setScore(int value) {
+ _score = value;
+ }
+
void draw() {
int x = 0;
int y = 0;
@@ -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('#');
View
@@ -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();
View
@@ -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.