From 2f7a3c71e06c45c2f087907c3a7bca7a92afe085 Mon Sep 17 00:00:00 2001 From: LindseyB Date: Sun, 24 Oct 2010 09:55:46 -0400 Subject: [PATCH] Added key press junk and the ability to just set the y coord. --- asciiSprite.d | 4 ++++ input.d | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/asciiSprite.d b/asciiSprite.d index 6a52863..48919c2 100644 --- a/asciiSprite.d +++ b/asciiSprite.d @@ -46,6 +46,10 @@ class AsciiSprite { _x = x; _y = y; } + + void setY(int y){ + _y = y; + } void drawSprite() { int y = _y; diff --git a/input.d b/input.d index fd834ce..f04ee8c 100644 --- a/input.d +++ b/input.d @@ -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;