Help with timing Updates

Started by
-1 comments, last by yckx 20 years, 5 months ago
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

This topic is closed to new replies.

Advertisement