5 ms·
If learning game programming interests you, you may want to try coding a 2d rectangle collision system. Not just intersection tests(that is the easy part) but a
by triplefox 18y ago
If learning game programming interests you, you may want to try coding a 2d rectangle collision system. Not just intersection tests(that is the easy part) but also a collision response that can either cleanly separate intersections or prevent them from occurring, the kind of thing you want for actor-environment collision.
It's actually a really hard problem to solve in both an accurate and fast manner without making major design assumptions. How wrong have people gotten it?
http://www.youtube.com/watch?v=Hgd3YcmIvYE http://www.youtube.com/watch?v=Hgd3YcmIvYE
http://tasvideos.org/RockmanTricks.html http://tasvideos.org/RockmanTricks.html
Mega Man's collision was above-average for its time, and holds up to normal play, yet it is full of exploitable bugs. If you can make a system that works well enough, you are most of the way to having a game, and the next most helpful thing to learn would be finite state machines and variants.