Advertisement

How to detect what side of an object you collide with.

Started by April 12, 2001 10:45 AM
11 comments, last by IronFist 23 years, 9 months ago
I made a game once with a bouncing ball. I had the same problem with checking which side the collision took place.
I solved it with a function in windows called intersectrect. Don''t know exactly what it was called but I think its what you need.
Your right...
just tryin to help

NitroSR seems to have it...I''ll have to remember that one...



Jenison
''There is no reason to have math part of the curriculum in schools. Why should we have to know 2x = 3y - 5. We have computers now." - Rosie O''Donnle
Advertisement
You could always use colormaps.
A nonvisible copy of your scene with colored areas instead of
there the actual tiles would be.
Then put a green area for the top of the tiles,
Red for the sides, yellow for sliding right and so on.
A 256 color bitmap would give you 256 different reactions to
your Mario character depending of which color he comes in contact with.
Then just get the pixelcolor at the specific coordinate

I have used this method since my Amiga days, it works for me.

<-Sweenie->

This topic is closed to new replies.

Advertisement