elemel / cannonball

2D physics puzzle game
MIT License
3 stars 0 forks source link

Physical cannons #23

Open elemel opened 15 years ago

elemel commented 15 years ago

Create Box2D bodies for all cannons and attach them to the cannonball body with prismatic joints. Also use damped springs for stability and recoil handling. Apply an impulse on the cannon when firing, corresponding to the impulse propelling the shot.

elemel commented 15 years ago

Box2D prismatic joints have a motor. See if we can use that to handle the recoil. The motor pushes the cannon rimwards. The impulses from the shots will push it hubwards. It's probably easiest to leave the motor on all the time.