SFML community forums
Help => General => Topic started by: Gio on June 02, 2010, 12:17:46 am
-
Im trying to write a Roguelike Game for my first SFML project and want to know if it is possible to use collision detection. If so, how? If not, are there any 2D physics engine/libraries that this can be integrated with? thanks!
-
Of course it's possible!
Some people use Box2D with SFML. It would be overkill for most roguelikes though. I don't know what experience you've had before SFML, but adding a physics (simulation) engine to your project is a fair bit of work and just increases the complexity and time it will take to finish.
There's a pretty good collision detection class in the wiki - http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection
Most roguelikes don't even need that level of collision detection - they just need to check if the player is on the same tile as an item or next to an enemy.
If you wanted a physics engine just for cool effects or something though, sorry for ranting :lol:
-
Besides Box2d there is a more lightweight and slightly faster 2d physics library Chipmunk.