O'Reilly logo

Cocos2d-x by Example : Beginner's Guide - Second Edition by Roger Engelbert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Our game – MiniPool

Our game consists of sixteen balls (circles), one cue (box), and a pool table made out of six lines (edges) and six pockets (circles). This is all there is to it as far as the Box2D simulation is concerned.

Download the final project from this book's Support page if you wish to follow along with the final code. Box2D is a complex API and it will be best to review and expose the logic rather than work on it by doing a lot of typing. So there will be no start project to work from this time. You may choose any manner to add files from the finished project to the one we started when I showed you how to set up the debug draw object. The final game will look like this:

Game settings

This is a portrait-orientation-only game, with no ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required