Box2D Ballooning


Many of you may of seen Pixars recent movie UP. In the movie the main character manages to take flight in his house by attaching dozens of inflatable balloons to the roof. Seems a bit far fetched don’t you think? Obviously the guys at Pixar aren’t too concerned with the laws of physics.
Well here at fatlinesofcode we don’t mind if cartoons break the laws of physcis either. But we do love to test them.
I have built a fun prototype game in Box2D to test this house ballooning theory. The house is a box with multiple balls attached via distance joints. Each of the balls has an anti-gravitational force applied to it which provides lift to the house. To pilot this balloon the UP arrow key is used to simulate adding more hot air to the balloons. Each time you press it an upward force is applied to each balloon thus providing more lift to the house. Additionally the LEFT and RIGHT arrow keys can be used to apply left and right forces to the house. Combining these controls you can achieve steady flight. Check out the demo and try manoeuvring your balloon through the various obstacles.

Source here

See more , ,


#1 Lorenz on 04.21.10 at 1:06 pm

Where can i see the code of this?

#2 phil on 04.21.10 at 4:22 pm

just added the source link.

#3 Dan on 01.09.11 at 8:14 pm

nice work! :) and thanks for including the source, much appreciated!

do you have any ideas on how to constrain the rotation of the balloons so they aren’t spinning all over the place? if you were to use real balloon shaped graphics on this it might look a bit odd.

#4 phil on 01.10.11 at 4:42 am

You can used fixedRotation to disable the rotation, also i think you might be able to create a new type of joint and limit the rotation that way

Leave a Comment