walk animation

This commit is contained in:
Eduardo Bart 2011-08-29 20:57:00 -03:00
parent 12661c1b1b
commit 4d47bb9ecf
1 changed files with 3 additions and 5 deletions

View File

@ -124,16 +124,14 @@ void Creature::draw(int x, int y)
else if(m_direction == Otc::West || m_direction == Otc::NorthWest || m_direction == Otc::SouthWest) else if(m_direction == Otc::West || m_direction == Otc::NorthWest || m_direction == Otc::SouthWest)
m_walkOffsetX = std::max(m_walkOffsetX - pixelsWalked, 0); m_walkOffsetX = std::max(m_walkOffsetX - pixelsWalked, 0);
//double walkOffset = std::max(m_walkOffsetX, m_walkOffsetY); int walkOffset = std::max(fabs(m_walkOffsetX), fabs(m_walkOffsetY));
/*if((32 - fabs(walkOffset)) / 8 % 2 == 0) { if(walkOffset % 8 == 0) {
if(m_animation+1 == attributes.animcount) if(m_animation+1 == attributes.animcount)
m_animation = 1; m_animation = 1;
else else
m_animation++; m_animation++;
}
//m_lastTicks = g_platform.getTicks();
}*/
if(((m_walkOffsetX == 0 && m_walkOffsetY == 0) && m_walkOffsetX != m_walkOffsetY) || if(((m_walkOffsetX == 0 && m_walkOffsetY == 0) && m_walkOffsetX != m_walkOffsetY) ||
((m_walkOffsetX == 0 || m_walkOffsetY == 0) && m_walkOffsetX == m_walkOffsetY)) { ((m_walkOffsetX == 0 || m_walkOffsetY == 0) && m_walkOffsetX == m_walkOffsetY)) {