Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In Box2D, how would I go about making a body that's being lifted by multiple "balloons"? These balloons would have to be able to be destroyed (for example, by a bow and arrow).

share|improve this question
3  
Your accept rate is zero. –  Den Nov 24 '11 at 13:46
add comment

1 Answer

up vote 5 down vote accepted

I would model the balloon as a circle shape physics-body and use ApplyForce to apply an upward force to the body. If the applied force is negative(gravity * mass), then the balloon should be standing still in the air. Applying a stronger force will cause the balloon to move upwards.

You can then connect another body to the balloon using joints (eg. a distance-joint). If the applied force on the balloon is strong enough, it should also lift the attached body. You might have to experiment with the force to apply and also with the mass of the bodies you want to attach to the balloons (the mass should be rather low to keep things realistic).

Destroying the balloon would simply mean to destroy the balloons physics body and maybe also the joint.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.