Skip to content

Commit

Permalink
Added key press junk and the ability to just set the y coord.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Oct 24, 2010
1 parent 679b441 commit 2f7a3c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asciiSprite.d
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class AsciiSprite {
_x = x;
_y = y;
}

void setY(int y){
_y = y;
}

void drawSprite() {
int y = _y;
Expand Down
4 changes: 4 additions & 0 deletions input.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ bool levelInput(LevelScreen screen, WINDOW* win){

while((key = getch()) != ERR){
if(key == Key.UpArrow) {
screen._arrowSect._input |= 4;
screen._dancingMan.setCurAnimation(Animate.UP);
} else if (key == Key.DownArrow) {
screen._arrowSect._input |= 8;
screen._dancingMan.setCurAnimation(Animate.DOWN);
} else if (key == Key.LeftArrow) {
screen._arrowSect._input |= 1;
screen._dancingMan.setCurAnimation(Animate.LEFT);
} else if (key == Key.RightArrow) {
screen._arrowSect._input |= 2;
screen._dancingMan.setCurAnimation(Animate.RIGHT);
} else if (key == 'q') {
return false;
Expand Down

0 comments on commit 2f7a3c7

Please sign in to comment.