Hello,
I'm working on a program and I need my character's feet to move back and forth while he's walking. I've got everything working with sf::Clock. Here's a snippet of my code:
void MovePlayer(int x, int y, int Player)
{
switch(Player)
{
case 1:
g_sPlayerHead.Move(x, y);
g_sPlayerBody.Move(x, y);
g_sPlayerFeet.Move(x, y);
g_sPlayerArms.Move(x, y);
int timer = FootImgClock.GetElapsedTime();
switch(timer)
{
case 0:
g_sPlayerFeet.SetSubRect(g_rcFeetMveA);
break;
case 1:
g_sPlayerFeet.SetSubRect(g_rcFeetMveB);
break;
case 2:
FootImgClock.Reset();
break;
}
default:
break;
}
}
The feet move too slow for my liking, once every second or so. How do I fix this? Is there a version of sf::Clock that measures in miliseconds?