How To Create A Breakout Game with Box2D and Cocos2D 2.X Tutorial: Part 2

Update 1/9/2013: Fully updated for Cocos2D 2.1-beta4 (original post by Ray Wenderlich, update by Brian Broom). This is the second and final part of a tutorial on how to create a simple breakout game using the Box2D physics library that comes with Cocos2D. If you haven’t already, make sure you go through part 1 first! […] By Brian Broom.

Leave a rating/review
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Gimme The Code!

Here’s the full code for the Cocos2D and Box2D Breakout Game that we’ve made in this tutorial.

Where To Go From Here?

Obviously this is a quite simple implementation of breakout, but now that you have this working there’s a lot more you can do. You could extend this code to give the blocks hit points and make the ball have to hit them a number of times before they are destroyed. You could add new blocks, let the paddle shoot lasers toward the blocks, whatever you dream up!

Let me know if you have any tips or suggestions for better ways to do things, and hope this comes in handy!

Brian Broom

Contributors

Brian Broom

Author

Over 300 content creators. Join our team.