From eb120e1252154885315dc66ac67f3993f286997b Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Sat, 17 Dec 2011 17:05:01 +0000 Subject: [PATCH] [Fix] NPC animation sequence. --- src/Unuk/Player.cpp | 2 +- src/libUnuk/NPC.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Unuk/Player.cpp b/src/Unuk/Player.cpp index fbc9b3b..fdf774b 100644 --- a/src/Unuk/Player.cpp +++ b/src/Unuk/Player.cpp @@ -8,7 +8,7 @@ Player::Player(Map *mapArg) : Character(mapArg) { } Player::~Player(void) { - +\ } void Player::HandleInput(void) { diff --git a/src/libUnuk/NPC.cpp b/src/libUnuk/NPC.cpp index 23f6ee0..328f32e 100644 --- a/src/libUnuk/NPC.cpp +++ b/src/libUnuk/NPC.cpp @@ -14,6 +14,11 @@ NPC::~NPC(void) { void NPC::Update(void) { Move(); + + if(xVel > 0) m_directionFacing = FACING_RIGHT; + else if(xVel < 0) m_directionFacing = FACING_LEFT; + else if(yVel > 0) m_directionFacing = FACING_DOWN; + else if(yVel < 0) m_directionFacing = FACING_UP; } void NPC::Move(void) {