Skip to content
Browse files

fixed various bugs and shitgit add .git add .

  • Loading branch information...
1 parent 943057b commit 9302b69073aa716193bd47dd173c907db3518ddb @LindseyB LindseyB committed Oct 24, 2010
Showing with 32 additions and 9 deletions.
  1. +3 −1 AAR.d
  2. +14 −3 backupDancer.d
  3. +8 −2 levelScreen.d
  4. +1 −1 levels.txt
  5. BIN sounds/fail.mp3
  6. BIN sounds/win.mp3
  7. +6 −2 warningBar.d
View
4 AAR.d
@@ -60,7 +60,8 @@ void main(){
currentLevel = selectS._levels[selectS._selectedLevel];
levelS = new LevelScreen(currentLevel);
-
+
+ listenforkey = true;
Shitz shitzShitty = new Shitz(levelS, win);
Thread inputThread = new Thread(&shitzShitty.callMyShit);
inputThread.start();
@@ -75,6 +76,7 @@ void main(){
}
void drawLevelScreen() {
+ userquit = false;
clear();
sc = new SoundClip("music/" ~ currentLevel._audio);
View
17 backupDancer.d
@@ -5,8 +5,8 @@ import tango.math.random.Random;
import animatedAsciiSprite;
class BackupDancer {
- enum Animate { DOWN, JUMP, LEFT, MOONWALK, RIGHT, UP, YMCA }
- AnimatedAsciiSprite[7] _animations;
+ enum Animate { DOWN, JUMP, LEFT, MOONWALK, RIGHT, UP, YMCA, THRUSTLEFT, THRUSTRIGHT, DISCO }
+ AnimatedAsciiSprite[10] _animations;
Animate _curAnimation;
this(int x, int y) {
@@ -17,6 +17,9 @@ class BackupDancer {
_animations[Animate.RIGHT] = new AnimatedAsciiSprite("graphics/man-right.txt", null, true, true, x, y);
_animations[Animate.UP] = new AnimatedAsciiSprite("graphics/man-up.txt", null, true, true, x, y);
_animations[Animate.YMCA] = new AnimatedAsciiSprite("graphics/man-ymca.txt", null, true, true, x, y);
+ _animations[Animate.THRUSTLEFT] = new AnimatedAsciiSprite("graphics/man-thrust-left.txt", null, true, true, x, y);
+ _animations[Animate.THRUSTRIGHT] = new AnimatedAsciiSprite("graphics/man-thrust-right.txt", null, true, true, x, y);
+ _animations[Animate.DISCO] = new AnimatedAsciiSprite("graphics/man-disco.txt", null, true, true, x, y);
}
void setCurAnimation(Animate animation) {
@@ -25,7 +28,7 @@ class BackupDancer {
void animate() {
if(_animations[_curAnimation]._frame == _animations[_curAnimation]._animation.length - 1){
- int random = rand.uniformR(7);
+ int random = rand.uniformR(10);
switch(random) {
case 0: _curAnimation = Animate.DOWN;
@@ -38,6 +41,14 @@ class BackupDancer {
break;
case 4: _curAnimation = Animate.UP;
break;
+ case 5: _curAnimation = Animate.THRUSTLEFT;
+ break;
+ case 6: _curAnimation = Animate.THRUSTRIGHT;
+ break;
+ case 7: _curAnimation = Animate.DISCO;
+ break;
+ case 8: _curAnimation = Animate.LEFT;
+ break;
default: _curAnimation = Animate.YMCA;
}
}
View
10 levelScreen.d
@@ -12,6 +12,7 @@ import asciiSprite;
import narwhal;
import backupDancer;
import warningBar;
+import util.soundclip;
class LevelScreen {
DataScore _score;
@@ -39,9 +40,9 @@ class LevelScreen {
void draw(bool fast) {
_score.setScore((-50*_arrowSect.misses) + (100*_arrowSect.good) + (200*_arrowSect.great));
- _warningBar.updateWarningBar(_arrowSect.misses, (_arrowSect.good + _arrowSect.great));
+ _warningBar.updateWarningBar(_arrowSect.misses, _arrowSect.great);
- if(_warningBar._level >= 32){
+ if(_warningBar._level >= 32 && _arrowSect.misses > 5){
endGame(false);
}
@@ -62,13 +63,18 @@ class LevelScreen {
}
void endGame(bool win) {
+ SoundClip sc;
_playing = false;
AsciiSprite winText = new AsciiSprite("graphics/victory.txt", null, false, 62, 15);
AsciiSprite loseText = new AsciiSprite("graphics/failure.txt", null, false, 62, 15);
if(win){
+ sc = new SoundClip("sounds/win.mp3");
+ sc.start();
winText.drawSprite();
} else {
+ sc = new SoundClip("sounds/fail.mp3");
+ sc.start();
loseText.drawSprite();
}
View
2 levels.txt
@@ -13,7 +13,7 @@ video_challenge-random.txt
Anamanaguchi_-_06_-_FloraFauna.mp3
FloraFauna
3
-flora_fauna-random.txt
+floral_fauna-random.txt
Anamanaguchi_-_07_-_Power_Supply.mp3
Power Supply
7
View
BIN sounds/fail.mp3
Binary file not shown.
View
BIN sounds/win.mp3
Binary file not shown.
View
8 warningBar.d
@@ -11,8 +11,12 @@ class WarningBar {
_level = 0;
}
- void updateWarningBar(int misses, int successes){
- _level += misses - successes;
+ void updateWarningBar(int misses, int great){
+ if(great == 0){
+ great = 1;
+ }
+
+ _level = cast(int)((cast(double)misses/(cast(double)great)) * 32.0);
if(_level > 32){
_level = 32;

0 comments on commit 9302b69

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