Box2D breakout prototype
Filed Under Actionscript 3, Box2D, Flash, Game design, Users contributions • 8 Comments
Porting Breakout/Arkanoid with Box2D seems to be an interesting challenge for developers.
Some days ago I showed you Phyballs, now it’s time for Andre Vidal to show his work.
Andre runs his own blog I suggest you to visit because you will find some interesting source code.
This is Andre’s breakout
(arrow keys = left and right paddle )
( everything is draggable with the mouse )
He used all the basic techiniques you ought to learn before adventuring into professional use of Box2d.
The bricks are hanging by distance joints attached to the body Ground, the paddle is fixed on the x axis by a prismatic joint attached also to the Ground.
The code looks for only 2 collisions, on ball against the paddle an Impulse is applied to the ball and on ball against a brick the brick distant joint is broken and the gravity acts on the brick (which makes it fall down).
They can be easily customized to meet the unique requirements of your project.
8 Responses to “Box2D breakout prototype”
Leave a Reply
- Citrus Engine released for free for learning
- My epic fail with ClickBank
- Get up to $100,000 for your next Flash game with Mochi GAME Developer Fund
- Create a dynamic content animated footer ad for your site in just 9 jQuery lines – 17 lines version
- Sell sitelocked version of your Flash games and even .fla sources to Free Online Games
- Protect your work from ActionScript code theft with SWF Protector
- Create a dynamic content animated footer ad for your site in just 9 jQuery lines
- Understanding Box2D’s one-way platforms, aka CLOUDS
- Triqui MochiAds Arcade plugin for WordPress upgraded to 1.2
- Box2D Flash game creation tutorial – part 2
- Create a Lightbox effect only with CSS - no javascript needed
- Flash game creation tutorial - part 1
- Create a Flash Racing Game Tutorial
- Flash game creation tutorial - part 2
- Make a Flash game like Flash Element Tower Defense - Part 2
- Flash game creation tutorial - part 3
- Make a Flash game like Flash Element Tower Defense - Part 1
- Create a flash draw game like Line Rider or others - part 1
- Triqui MochiAds Arcade plugin for WordPress official page
- Create a flash artillery game - step 1
- Flash game creation tutorial – part 5.2 (4.88/5)
- Create a flash artillery game – step 1 (4.79/5)
- Create a Flash Racing Game Tutorial (4.76/5)
- Create a survival horror game in Flash tutorial – part 1 (4.74/5)
- Create a flash artillery game – step 2 (4.74/5)
- Creation of a Flash arcade site using WordPress – step 2 (4.73/5)
- Flash game creation tutorial – part 1 (4.71/5)
- Flash game creation tutorial – part 2 (4.71/5)
- Create a flash draw game like Line Rider or others – part 1 (4.69/5)
- Creation of a platform game with Flash – step 2 (4.68/5)





Great one! Got the 1st comment space, wow!
Hey emanuele, did u recieve my new game on ur mail?
OH My Freggin’ GOD, do you guys imagine how cool this would be as a full game? Do you guys imagine how cool platform, shooting, adventure (etc) games you can make with this? I cant see Box2D in games. I mean, almost no one is using it, Why?
Greetings from indignant Peter (sweden).
um, it’s really easy, because you can just drag the ball and knock the bricks of of thier joints.
you don’t even have to use the paddle…
The paddle does not work like in Breakout ;-) Check out b2ContactListener :-)
I’ve seen Box2D in tons of games … I think. Or they were using their own physics engine.
This is very off-topic, but Emanuele, we need you to make some mods in the forums! They have been invaded by spam!
Apparently many people have tried to contact you via email and PMs but you haven’t answered.
See the topic in forum entitled “SPAM OUT OF CONTROL” for more info.
Quite, sorry for the O/T-ness but we can’t really cope with the spam… every visit I’m deleting posts from -every- forum, and it’s getting rather… risqué to say the least.
Some for of bot control would be welcomed! Or the ability to delete ALL posts from a user when banning them.
Hei Emanuele, i have one problem with Box2D, i need change the gravity for time, but just using the function setGravity in my b2World, not working, i have to do something to change this value?
And good work with box2D, i use APE until i read your blog! Now i try to forgeth the APE!
look at this simple thing i do with APE:
http://www.brunomikoski.com/2008/08/08/source-acquaplay-jogo-desenvolvido-em-ape-actionscript-3/