summaryrefslogtreecommitdiff
path: root/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Creature.cpp')
-rw-r--r--Creature.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Creature.cpp b/Creature.cpp
index 7693cb9..ba2a790 100644
--- a/Creature.cpp
+++ b/Creature.cpp
@@ -38,3 +38,14 @@ int Creature::getHealth() {
void Creature::setHealth(int h) {
health = h;
}
+
+void Creature::orient() {
+ if (xVel < 0)
+ clipNo = ORIENT_LEFT;
+ else if (xVel > 0)
+ clipNo = ORIENT_RIGHT;
+ else if (yVel < 0)
+ clipNo = ORIENT_BACK;
+ else
+ clipNo = ORIENT_FRONT;
+}