-
Collisions.
I was just wondering how you go about doing collisions. The easy way is to do the 'intersect' code, but that works only with rectangles. Another way is to have the coordinates of each line and check with something that has the coords of the character and the object with the boundaries, but then round objects can still be a problem. Also, if you happen to have a thin 'pole' in the middle of the playing field and its width is smaller than the distance you are traveling you might pass right through it.
Anyways, all that was said to ask: How do you go about collision detection?
-
Your code must have a way to determine if two graphical objects share some
2D space. One way to do it is to make an abstract superclass that extends the
Polygon class and defines some basic methods like draw, move and perform and also
has a defined center Point. Descendants from this class should easily give the
collision precision you need.
-
Hi
I will sugestd that you take a closer look at this homepage:
http://www.diku.dk/~kenny/pubs.html
This homepage has some good stuff about collision detection.