Advertisement

collision detection in maze issue

Started by September 18, 2015 12:27 AM
10 comments, last by MarkS_ 9 years, 3 months ago

I will make my own Pacman one day and I think I can understand the cornering for Pacman. This allows him to get away from ghosts who can't cut corners. I assume the original Pacman didn't have to worry about time steps etc because they knew exactly how fast the game was going to run because the hardware was the same for everyone. IE Arcade machines, C64's etc.

Actually they didn't "worry about time steps" for technical reasons: older hardware like that simply doesn't have the processing power for variable time steps.

Variable time steps require constantly multiplying values by the delta time. Mutiplication is extremely slow on 8-bit CPUs, and still fairly slow on most 16-bit CPUs.

Instead, games on those older types of hardware would just use a fixed time step, use the vertical retrace interrupt (which occurs at a fixed frequency based on the display system) for timing, and if any given step took too long to process, the game would just slow down.

My ultimate goal for this will be a little game, something like Boulderdash crossed with Pacman.


I apologize. I didn't finish my thought; it was a LONG day for me. We are trying to help you based on a very rudimentary image. Is it safe to assume that the graphics shown are simply placeholder graphics? If so, your character bounding box is far too large. In fact, it is far too large even if these are the final graphics! The collision bounds needs to be as small as possible so as to not cause false positives. There is precious little reason for your character's collision bounds to be so large as to force a collision with the environment. As it stands now, your character is always in contact with the walls. If you were to use an actual physics library, your character wouldn't move at all.

All of your problems would go away if you were to reduce the size of the blue square and you would have a much easier time if it were a circle and you did a radius collision test.

This topic is closed to new replies.

Advertisement