Skip to content
Snippets Groups Projects
Commit 5fb2c135 authored by Claudio Hoffmann's avatar Claudio Hoffmann
Browse files

Player: Increase movement animation speed (by a lot)

parent 490efb8b
Branches
No related tags found
No related merge requests found
...@@ -186,15 +186,10 @@ void Player::move(Platform &p, FloatSeconds const & Frametime, Level &level) ...@@ -186,15 +186,10 @@ void Player::move(Platform &p, FloatSeconds const & Frametime, Level &level)
if(deltaX!=0||deltaY!=0) if(deltaX!=0||deltaY!=0)
{ {
if(animationtimer>speed*Frametime.count()) int constexpr ANIMATION_FRAMES = 2;
{ float constexpr ANIMATION_FRAME_TIME = 0.1f;
animationstep = 1-animationstep;
animationtimer = 0;
}
else
{
animationtimer += Frametime.count(); animationtimer += Frametime.count();
} animationstep = static_cast<int>(animationtimer / ANIMATION_FRAME_TIME) % ANIMATION_FRAMES;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment