O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

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

Creating complex shapes

If your object still can't fit in a box or a circle subshape, you can specify array points to create a body with an abnormal shape.

Getting started

For this section, you will require the candyStick.png file from the resource and need to download the vertexHelper source file from GitHub.

While creating complex shapes, it is necessary to get the vertices of the shape of the object that you want to create. You can get this by importing the image into Photoshop or Paint and manually getting the individual points, which is the hard way of doing it. The easy way is to use the vertex helper app, in which you can just import the image and click on the points where you want the vertices, and it will generate the coordinates for you ...

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