Sign in to follow this  
devdber

2d collisions

Recommended Posts

devdber    173
Hi there! Im getting to learn XNA. Could you give me some examples of simple 2d physics and collision detection? I've tryed to make my own physics but i failed in it because im not skilled coder yet [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
Sorry for my poor english, im from Russia!

Share this post


Link to post
Share on other sites
renman29    675
Not sure which types of collision detection would be most useful to you. If you're doing 2d tile platformer these might help:
Types of tile based collision methods:
[url="http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/"]http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/[/url]
Pixel perfect collision detection:
[url="http://gamedev.stackexchange.com/questions/15191/is-there-a-good-way-to-get-pixel-perfect-collision-detection-in-xna"]http://gamedev.stackexchange.com/questions/15191/is-there-a-good-way-to-get-pixel-perfect-collision-detection-in-xna[/url]
Here you can find rectangle-based collision detection source code - also links to pixel-collision and others:
[url="http://xbox.create.msdn.com/en-US/education/catalog/tutorial/collision_2d_rectangle"]http://xbox.create.msdn.com/en-US/education/catalog/tutorial/collision_2d_rectangle[/url]

I'm thinking rectangle-rectangle collision detection works for most things (but may want to try bounding-circle [radius-overlap] for some things)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this