Posted: 17th Oct 2011 16:54
I read the documentation about the moving the sprite based on time, and I have implemented it. But, not for my surprise, the code the way is shown in the documentation moves my sprite only every second. Is that really as it looks like?

Later I saw here in the forum someone mention the GetFrameTime which seems to do exactly what the code in the docs intend to do. Are really they equivalent.

Independent of the code used, I then tried to use floats instead of integers to move my sprite smoothly, but that make me think if I'm not wasting CPU cycles setting the same sprite position over and over. Should I check if x and y are the same before calling the function. Is it worth?

Any help is appreciated!

Thanks
Posted: 17th Oct 2011 17:42
Independent of the code used, I then tried to use floats instead of integers to move my sprite smoothly, but that make me think if I'm not wasting CPU cycles setting the same sprite position over and over. Should I check if x and y are the same before calling the function. Is it worth?

It's quicker to set the position every loop than it is to check if it needs setting and then set it (that's two operations instead of one). Setting sprite position is very quick, I wouldn't worry about it.
Posted: 17th Oct 2011 19:26
Setting the position of a sprite every loop is the standard way to do it.