Skip to content

Commit

Permalink
fixed various bugs and shitgit add .git add .
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Oct 24, 2010
1 parent 943057b commit 9302b69
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
4 changes: 3 additions & 1 deletion AAR.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -75,6 +76,7 @@ void main(){
}

void drawLevelScreen() {
userquit = false;
clear();

sc = new SoundClip("music/" ~ currentLevel._audio);
Expand Down
17 changes: 14 additions & 3 deletions backupDancer.d
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;
Expand All @@ -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;
}
}
Expand Down
10 changes: 8 additions & 2 deletions levelScreen.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import asciiSprite;
import narwhal;
import backupDancer;
import warningBar;
import util.soundclip;

class LevelScreen {
DataScore _score;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion levels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added sounds/fail.mp3
Binary file not shown.
Binary file added sounds/win.mp3
Binary file not shown.
8 changes: 6 additions & 2 deletions warningBar.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9302b69

Please sign in to comment.