Hi
I try to make a little 2d-shooter-like multiplayer game in flash. Everything works niceley so far, but the time based movement is not working like it should. I have a mainloop in the server (setInterval) that should run once every 30ms. I use GetTimer() to get the actual timedifference between two cyles of the mainloop, because gravity etc must be time based so that even if the server would only be able to run one cycle every 500ms all players would fall the same distance in the same time. Now to my problem: I traced the timedifference, and it lies between 30 and 300 ms (I ran some programs to simulate CPU-lag). The time based movement that I use should compensate for that - but when a player jumps he always jumps a different height - so the time I use to make the time based movement is not the actual time that has passed betwee two cyles. Could it be that GetTimer() is not that accurate ? I hope you can understand what I mean, sorry for my bad english...
Thanks in advance
GetTimer() Question
Hi,
don't worry your english is good.
Anyways I am not sure if I understand the "jump" problem.
don't worry your english is good.
The getTimer() returns a time value expressed in milliseconds, which is of course accurate unless you need a finer time resolution (but I guess milliseconds should be enough)Could it be that GetTimer() is not that accurate ?