Collision Detection for Platforms

Started by
1 comment, last by yckx 17 years, 10 months ago
With my current game i'm working on I've been trying to implement a system for collision detection. Its coming along decently but i'm having some issues trying to get jumping up onto something to work properly. What I've implemented is a system of vectors protruding out of the character. I have a total of four vectors coming out of each object. vectors The way it works is each frame I check to see if a certain vector is within another object, if so a collision occurs. Well I thought this was pretty straight forward for landing on an object, I would just determine if my vecGravity vector is within an object and push it back up. Well it doesn't seem to be working. Is my basic theory wrong for this, or is there a better way to go about this. Reason I'm using vectors instead of Rect's is I figured that by doing this it would create a better more realistic physics within the program. Also I would be able to implement other nifty things like sliding down slopes and such. Thanks for your time. Slyprid
Advertisement
I finally got it to work. I had the right idea, but found out some of my numbers were not coming out right after fixing those the world is full of gravity now. Now to apply it to other objects. :D

Slyprid
This is essentially a simple bounding box.

This topic is closed to new replies.

Advertisement