From c3d21fc576401efc24b77b4e83bfcd43eee9b70a Mon Sep 17 00:00:00 2001 From: LindseyB Date: Sun, 24 Oct 2010 14:01:35 -0400 Subject: [PATCH] added the warning bar --- dancingMan.d | 14 ++++++-------- levelScreen.d | 13 +++++++++++++ narwhal.d | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/dancingMan.d b/dancingMan.d index f79af4a..baec31e 100644 --- a/dancingMan.d +++ b/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) { diff --git a/levelScreen.d b/levelScreen.d index 0c8fee0..3927f57 100644 --- a/levelScreen.d +++ b/levelScreen.d @@ -10,6 +10,8 @@ import arrowSection; import dancingMan; import asciiSprite; import narwhal; +import backupDancer; +import warningBar; class LevelScreen { DataScore _score; @@ -17,6 +19,9 @@ class LevelScreen { DancingMan _dancingMan; AsciiSprite _spotlight; Narwhal _narwhal; + BackupDancer _backup1; + BackupDancer _backup2; + WarningBar _warningBar; bool _playing; @@ -24,19 +29,27 @@ class LevelScreen { _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(); } } diff --git a/narwhal.d b/narwhal.d index 728aa0e..eefd88a 100644 --- a/narwhal.d +++ b/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);