Skip to content
Browse files

added the warning bar

  • Loading branch information...
1 parent 0419f6b commit c3d21fc576401efc24b77b4e83bfcd43eee9b70a @LindseyB LindseyB committed Oct 24, 2010
Showing with 20 additions and 9 deletions.
  1. +6 −8 dancingMan.d
  2. +13 −0 levelScreen.d
  3. +1 −1 narwhal.d
View
14 dancingMan.d
@@ -2,8 +2,6 @@ module dancingMan;
import animatedAsciiSprite;
import types;
-import ncurses;
-import tango.stdc.stringz;
class DancingMan {
AnimatedAsciiSprite[6] _animations;
@@ -12,12 +10,12 @@ class DancingMan {
this() {
// init animations
- _animations[Animate.DOWN] = new AnimatedAsciiSprite("graphics/man-down.txt", null, true, false, 26, 22);
- _animations[Animate.LEFT] = new AnimatedAsciiSprite("graphics/man-left.txt", null, true, false, 26, 22);
- _animations[Animate.MOONWALK] = new AnimatedAsciiSprite("graphics/man-moonwalk.txt", null, true, false, 26, 22);
- _animations[Animate.RIGHT] = new AnimatedAsciiSprite("graphics/man-right.txt", null, true, false, 26, 22);
- _animations[Animate.UP] = new AnimatedAsciiSprite("graphics/man-up.txt", null, true, false, 26, 20);
- _animations[Animate.YMCA] = new AnimatedAsciiSprite("graphics/man-ymca.txt", null, true, false, 26, 22);
+ _animations[Animate.DOWN] = new AnimatedAsciiSprite("graphics/man-down.txt", null, true, false, 26, 24);
+ _animations[Animate.LEFT] = new AnimatedAsciiSprite("graphics/man-left.txt", null, true, false, 26, 24);
+ _animations[Animate.MOONWALK] = new AnimatedAsciiSprite("graphics/man-moonwalk.txt", null, true, false, 26, 24);
+ _animations[Animate.RIGHT] = new AnimatedAsciiSprite("graphics/man-right.txt", null, true, false, 26, 24);
+ _animations[Animate.UP] = new AnimatedAsciiSprite("graphics/man-up.txt", null, true, false, 26, 22);
+ _animations[Animate.YMCA] = new AnimatedAsciiSprite("graphics/man-ymca.txt", null, true, false, 26, 24);
}
void setCurAnimation(Animate animation) {
View
13 levelScreen.d
@@ -10,33 +10,46 @@ import arrowSection;
import dancingMan;
import asciiSprite;
import narwhal;
+import backupDancer;
+import warningBar;
class LevelScreen {
DataScore _score;
ArrowSection _arrowSect;
DancingMan _dancingMan;
AsciiSprite _spotlight;
Narwhal _narwhal;
+ BackupDancer _backup1;
+ BackupDancer _backup2;
+ WarningBar _warningBar;
bool _playing;
this(Level currentLevel) {
_score = new DataScore(currentLevel._name);
_arrowSect = new ArrowSection(currentLevel._arrowChart);
_dancingMan = new DancingMan();
+ _backup1 = new BackupDancer(20, 20);
+ _backup2 = new BackupDancer(32, 20);
_playing = true;
_spotlight = new AsciiSprite("graphics/spotlight.txt", null, false, 10, 18);
_narwhal = new Narwhal();
+ _warningBar = new WarningBar();
}
void draw(bool fast) {
+ updateWarningBar(_arrowSect.misses, _arrowSect.good+g_arrowSect.great);
+
move(0,0);
_score.draw();
+ _warningBar.draw();
_spotlight.drawSprite();
_arrowSect.draw(fast);
_dancingMan.draw();
_narwhal.animate();
_dancingMan.animate();
+ _backup1.animate();
+ _backup2.animate();
}
}
View
2 narwhal.d
@@ -25,7 +25,7 @@ class Narwhal {
void animate() {
if(_animations[_curAnimation]._frame == _animations[_curAnimation]._animation.length - 1){
// switch animations?
- if(_curAnimation == Animate.BREAKDANCE){
+ if(_curAnimation != Animate.DANCE){
_curAnimation = Animate.DANCE;
} else {
int random = rand.uniformR(20);

0 comments on commit c3d21fc

Please sign in to comment.
Something went wrong with that request. Please try again.