I couldn't play your game beacuse of it's so fast! I know I should just set it to use VSync, but come on, this not how it's intended to be!
What problems do you experience when using framerate independent movement and animation? I do the same, for all the thing that should change over time. I don't use clocks - at least not for important stuff - because then the game would not be synchronized well.
Here's some pseudo code for movement:
sf::Vector2Df position(sprite.GetPosition());
sf::Vector2Df shift;
float playerSpeed = 20;
float deltaTime = float(Window.GetFrameTime()) / 1000.f;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Left)) shift.x = -deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Right))shift.x = deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Up)) shift.y = -deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Down)) shift.y = deltaTime * playerSpeed;
position += shift;
/* ... Do some collision and response which modifies position vector too ... */
sprite.SetPosition(position);
Here's some for animation:
[animationTimer, animationFrame, maxAnimationFrames are integers declared in your class outside this function]
int animationSpeed = 200; // 1/5 second
animationTimer += int(Window.GetFrameTime());
if (animationTimer > animationSpeed)
{
animationTimer -= animationSpeed;
++animationFrame;
/* With the two lines above actually you can go out of sync
with your animation, but only if the FrameTime is too large.
If it is, the game must be unplayable anyway, so I tend to
ignore this possibility. */
if (animationFrame > maxAnimationFrames) animationFrame = 0;
}
sprite.setAnimationFrame(animationFrame); // This is really pseudo!