1
\$\begingroup\$

I'm working in SDL and have bounding rectangles for collisions set up for each frame of the sprite's animation. However, I recently stumbled upon the issue of putting together collisions for characters walking up and down hills/slopes with irregularly curved or rocky terrain - what's a good way to do collisions for that type of situation? Per-pixel? Loading up the points of the incline and doing player-line collision checking? Should I use bounding rectangles in general or circle collision detection?

\$\endgroup\$
1
  • \$\begingroup\$ What is your problem specifically? Is it the collision detection or response? Try to be a little more specific. \$\endgroup\$ Commented Sep 26, 2013 at 23:19

2 Answers 2

1
\$\begingroup\$

You should read this guide Implementing Slopes

It is quite detailed and even though I haven't programmed slopes yet it has a lot of useful information and tell you not only ways of doing it, but you'll also find out how they were made on games you know well, so that's always a plus :)

\$\endgroup\$
0
\$\begingroup\$

If you want to apply real physics, you have to use physical engine. You can make your own physical engine but it implies a huge physical and programming knowledge. I would recommend you to use Box2D which is a good 2D physical engine written in C++. There are lot of tutorials about Box2D from which you can learn it easy and quickly. Here is also the official manual for it.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .