#166306 - bollkalle - Wed Feb 04, 2009 4:31 pm
Hi! I'm new here at gbadev and I am from Sweden. I have a question.
I want to make such a collision map, or something else that makes the character stop when he collides with a solid objects. Anyone who knowes that?
/bollkalle
#166308 - elhobbs - Wed Feb 04, 2009 4:41 pm
that is a very hard question to answer as it depends a lot on how you are internally storing objects. there are a lot of options, bsp trees, bounding boxes, directly intersecting the geometry - just to list a few. you may want to search google for collision detection.
#166309 - bollkalle - Wed Feb 04, 2009 4:43 pm
OK. Thank you for answering! Now I'll search on Google!
#166328 - gauauu - Wed Feb 04, 2009 8:43 pm
If you are doing basic 2d tiled sprite games, the easiest is usually to have a bounding box for your character and other sprites, and test bounding box collisions (for object-object collisions) and for object-map collisions, have a map that tells whether each tile (or meta-tile) is a collision or not (or what type of collision) and then check the character's bounding box against the looked up collision value for tiles that intersect the bounding box.
#166471 - sgeos - Sun Feb 08, 2009 6:00 pm
As others have eluded to, it depends on what you are doing. What are you specifically trying to do?