Archived

This topic is now archived and is closed to further replies.

Help with timing Updates

This topic is 5151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on a pacman clone. I had originally implemented time based movevement by setting a movement rate for objects and mutiplying the rate by the time since their last update. The problem with that is that occasionally the player/ghosts would miss turns, because the movement would cause them to "jump" past the maze intersection. So then I decided to give them a constant move distance (ensuring they will hit the intersection), and updating them periodically. For example, the player would get updated every 100ms, and ghosts would get updayed, say, every 80ms normally, and ecery 120ms after the player eats a power pill. I am unsure how to implement this. Can I somehow keep a single timer class for objects to poll, or does each object need to keep its own dime? And is there a better way to do this? Thanks yckx

Share this post


Link to post
Share on other sites