Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XNA C# 2D Platformer Game

I'm trying to make (figure out how to..) a 2d platformer in XNA.

I know how to create a tile grid and how to perform collision detection. I perform collision detection on the 9 bounding tiles of the player, but I'd like to know if there's a better way to perform collision detection.

I've read Braid doesn't use tiles but pieced images or something, how do you perform collision detection on those? and is that better than using tiles?

like image 992
Restart Avatar asked Feb 09 '10 09:02

Restart


2 Answers

Assuming you don't mind using a third party tool to do the majority of the work for you, you may be better off using something like Box2D for C#.

http://www.box2d.org/ http://code.google.com/p/box2dx/

This library will give you collision detection and physics capabilities.

like image 58
xgalaxy Avatar answered Sep 30 '22 08:09

xgalaxy


If you're going for a retro style then it's certainly fine to use tiles! However, if you want something more "modern", then you can go with a more conventional physics engine. Farseer Physics is a great engine, and several people have used it to make platformers. It's based on Box2D and similar engines, but offers a simpler API and several unique features (like texture to geometry) and i myself can testify to it's niceness having played around with it a bit.

like image 45
RCIX Avatar answered Sep 30 '22 08:09

RCIX