In my game, I have a constant stream of missiles - my goal is to have the missiles fly along a path that's randomly chosen from a collection of possible paths. What I'm not sure about is how to handle this with Box2d-based collision and physics.
My current plan is to move my AtlasSprite using a BezierBy action, and to update the position of a b2Sensor with each tick in my physics system to match the sprite. I think this will work, but I'm not sure how expensive it is or what kind of control I'll have over collision reactions.
My preferred plan would be to apply forces to the missiles to approximate the path, and to have full benefit of the physics system.
My knowledge of Box2d (and physics engines in general) is pretty limited, though - would something like this be possible? My best guess would be to constantly look at the path ahead of the missile and apply impulse and torque to maintain the path and rotation. Seems like it would be pretty tricky to keep a smooth, natural motion at a consistent velocity.
Anyone else have any ideas on this? The paths will be fairly complex (more so as the difficulty increases in the game), so a simple direction and constant force won't really do the trick.
Thanks for reading, and for any suggestions/guidance,
Chris