thanks in advance for any help!
I'm learning the box2d
tutorial about adding bodies to my game however it seems they are just drawing with the debugrenderer.
I am just practicing, and I have a zelda snes style game map and hero character loading fine. In my gamemap I have objects (rectangle map objects) shoing tree stumps rectangles (which I want to use to stop hero walking through a tree).
Can Box2d
be used in this example? I dont want any gravity/friction/mass
etc but what I want to do is make 'static bodies' from the tree stump rectangles which I can detect collision with my hero's rectangle. Of course I can just write my own code to check collision but it is always buggy and I am struggling to think of the correct way to loop all the tree stump rectangles and stop the hero walking through it.
(NOTE: I also am part way through writing a platformer. It is all working well and he lands on the platforms but Im not using Box2d
and for example it doesnt fall off when you walk over edge of platform it keeps going until you jump then it detects where platform is. - hence why I wanted to learn box2d
)
Can box2d
make these static bodies (in the way I say above) and if so , how can you link the bodies to the sprite you already have (AND the rectangle array I pulled from my TMX file
)
Hope this is clear for people. Many thanks