I’m looking for any sort of tutorial that helps me get up and running with either box2d or napePhys. I’ve tried implemented it myself but failed. I’m not entirely sure how to work with physics libraries since I’ve never done it before.
My main problem lies in the samples where they always use shapes such as polygons etc. Never sprites/tilesheets that you’d actually use in a game.
Are there any decent resources out there for Haxe/openfl?
Physics libraries don’t use sprites or tilesheets,
you have to make circle/rectangle/polygon/… yourself.
You update the physics and then you draw your tiles/sprites accordingly to the physic location/rotation/…
So what it basically means is that i need to draw my sprites ontop of the shapes or am i not understanding this correctly?
The shapes aren’t drawn if that’s what you’re asking.
They only exists in the physics library, which tell you where the shapes are.
To choose to draw the sprites where the shapes are is the logical course of actions, but nothing forces you to do so.
The shape and the sprite are only “linked” because you choose so.
Drawing is one part.
Mechanics are the other one.
The physics engine deals with the mechanics (you have an object this shape in this position, how does it behave according to “physics” rules? those engine are the answer)
You have to deal with the drawings.
You can actually fuse them in one object that can be drawn and has specific parameter to be fed to the physics engine.
You should start with some tutorial or example
start from here