0
votes

Hi i am trying to write simple game where there is one player and some simple world like trees or some buildings, player can walk having muchine gun and shoot to world object like trees and finally destroy it, game is top-down so i don't need any gravity. Player can hit a lot of bullets and some monster in world can shoot to. SO there can be a lof of bullets in one time on the screen so i need some good tool to make colision detection. Also important is that player can't now walk on other object, like there is a monster and player and they can't exist in the same place (one shouldn't go on another). Can you recoment me some collision detection engine, mayby should I use Farser or better I should write it my self?

simillar to this http://www.youtube.com/watch?v=u8rWomjyTWI

I have one more question, i am still reading about xna since few days, and i know now that if it goes about colision detection we have pixel or square and circle, now: is there any toll or engine which can pare a texture mappe it into a polygon and check colision?

1
There are several collision detection examples out there, you just have to google it. Also, 2D collision isn't really hard, so you should try implementing it yourself to learn.Msonic
i know there are plenty, look on my second questionkosnkov
You may want to try per pixel collision, as demonstrated here. It may be a little overkill if you only want to check if a pixel is inside a square or circle.Msonic
no be sure i want a polygons, on one view can be like few thousends of bullets and like 100 characterskosnkov
Well... your bullets can be represented as pixels, and the characters as rectangles? It'll save a lot of CPU if you do rough collision detection rather than pixel perfect collision, especially in a top-down like this.Msonic

1 Answers

2
votes

Farseer is for physics. Use it if you need complex collision reaction. If you simply need if colission then kill player, you don't need such an engine or library.

Did you read the collision example in the App Hub right?
Link: http://create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel_transformed

Thats probably just enough for your purposes.