That's interesting. I'll try implementing this.
It heads toward the point at a way-too-fast speed, then slows down before it gets there. It does move the same incorrect speed each time, and it's way off. The problem is the math. It's just plain wrong and needs to be redone.
Does this movement happen when you start the game or immediately after some long calculation, and slow down to the correct speed after about 1 second?
Anyway, correct it by using current_time or the high resolution timer to compute per-frame time differences. (Save current_time to a variable each step, after using the difference between it and the variable as your time difference)
EDIT: I forgot to mention it, but the problem is that the fps variable updates once a second, and includes time spent during startup (so it starts at 0) and long calculations (so your preparations for the movement might reduce the fps variable (but not actual framerate) for up to a full second after they happen. This is almost certainly the source of your problem.
blackmoonMember Since 06 Jul 2009
Offline Last Active Aug 19 2012 09:34 PM
- Group New Member
- Active Posts 421
- Profile Views 2468
- Member Title "Execute order 66."
- Age 17 years old
- Birthday June 2, 1995
- Website URL http://nevereal.net/mc_server.html