Skip to content

Commit

Permalink
added the warning bar
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Oct 24, 2010
1 parent 0419f6b commit c3d21fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
14 changes: 6 additions & 8 deletions dancingMan.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module dancingMan;

import animatedAsciiSprite;
import types;
import ncurses;
import tango.stdc.stringz;

class DancingMan {
AnimatedAsciiSprite[6] _animations;
Expand All @@ -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) {
Expand Down
13 changes: 13 additions & 0 deletions levelScreen.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

}
2 changes: 1 addition & 1 deletion narwhal.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3d21fc

Please sign in to comment.