[Help] Smooth movement SFML 2.1
Hi, i'm trying to move a sf::RectangleShape :
m_Rectangle.move(15 * -1, 0);
but it's very jerky.
Plus when I press a Key there is a little latency.
Can you help me pls :)
Last edited on
It's a sf::RectangleShape
Why are you calling "Sleep()"? This might be your problem.
Thanks for your answer but I tried with and without with some different values but I've always the same problem.
Then check to see what event you are triggering this check on. Or better yet post your entire running loop.
if (event.type == sf::Event::Closed)
mapManager is an object which stocks my objects into a std::map<std::string, Obj*>
It's use to update all my Obj with updateAll()
for (std::map<std::string, Blocks*>::const_iterator i = m_VecMap.begin(); i != m_VecMap.end(); ++i)
One of my Obj is a Rectangle that I try to move with the first code I posted
You definately don't want that call to Sleep, maybe you want to set window.setFramerateLimit()?
Are you setting the velocity back to zero when the key is released?
Topic archived. No new replies allowed.