kubiczi123
RoFT- First and last memb
Hey. Im in search of improving the UX of player movement.
Currently the character moves diagonally very fast, then has to wait.
Is there a way to sync the character movement speed with the movement cooldown? (As in, you can walk right again after the diagonal movement animation is done)
Alright nevermind...
Already found it.
client/src/creature.cpp
Simply change the "true" in getStepDuration() to "false".
Currently the character moves diagonally very fast, then has to wait.
Is there a way to sync the character movement speed with the movement cooldown? (As in, you can walk right again after the diagonal movement animation is done)
Post automatically merged:
Alright nevermind...
Already found it.
client/src/creature.cpp
C++:
void Creature::updateWalk(const bool isPreWalking)
{
const float walkTicksPerPixel = getStepDuration(true) / static_cast<float>(g_gameConfig.getSpriteSize());
const int totalPixelsWalked = std::min<int>(m_walkTimer.ticksElapsed() / walkTicksPerPixel, g_gameConfig.getSpriteSize());
// needed for paralyze effect
m_walkedPixels = std::max<int>(m_walkedPixels, totalPixelsWalked);
updateWalkAnimation();
updateWalkOffset(m_walkedPixels);
updateWalkingTile();
if (m_walkedPixels == g_gameConfig.getSpriteSize()) {
if (isPreWalking) resetWalkAnimationPhase(true);
else terminateWalk();
}
}
Simply change the "true" in getStepDuration() to "false".
C++:
uint16_t Creature::getStepDuration(bool ignoreDiagonal, Otc::Direction dir)