diff options
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/player.cpp b/src/player.cpp index 46d3b938..52f2cdb0 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -47,19 +47,14 @@ Player::logic() { switch (mAction) { case WALK: - mFrame = (get_elapsed_time(mWalkTime) * 6) / mWalkSpeed; - if (mFrame >= 6) { + if (get_elapsed_time(mWalkTime) >= mWalkSpeed) + { nextStep(); } break; case ATTACK: - int frames = 4; - if (getWeapon() == 2) + if (get_elapsed_time(mWalkTime) >= mAttackSpeed) { - frames = 5; - } - mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed; - if (mFrame >= frames) { nextStep(); } break; |