I'm trying to figure out how Box2D works and am currently phailing miserably. I'm planning on using Box2D with SFML, using Box2D mainly for collision detection. Unfortunately I'm having trouble figuring out how to work Box2D properly. I (think) I've gotten the unit scaling to work but now my problem is keyboard input. My game is a simple 2D space shooter where the player moves with either the arrow keys or WASD. How do I change a b2Body's position manually? Or do I have to use forces, impulses, etc?
I saw a similar post on the AS3 subforum and I tried to use Impulses, which worked fairly well, but I want the Body to stop moving when I release the arrow key. How would I do that? I tried a setLinearVelocity but all that did was prevent the Body from moving at all.
I saw a similar post on the AS3 subforum and I tried to use Impulses, which worked fairly well, but I want the Body to stop moving when I release the arrow key. How would I do that? I tried a setLinearVelocity but all that did was prevent the Body from moving at all.