Book Image

Cocos2d Game Development Blueprints

By : Jorge Jordán
Book Image

Cocos2d Game Development Blueprints

By: Jorge Jordán

Overview of this book

Table of Contents (15 chapters)
Cocos2d Game Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Defining shapes


There are several tools that can help us define the shapes of our objects so we can manage collisions in an accurate way. Some of them are paid and some of them are free.

Between the most important editors, we find Physics Body Editor (former box2d-Editor, http://www.aurelienribon.com/blog/projects/physics-body-editor/) and R.U.B.E (https://www.iforce2d.net/rube/), which are compatible with Chipmunk and PhysicsEditor (https://www.codeandweb.com/physicseditor).

In this chapter, we are going to cover PhysicsEditor as it's the most popular of the previous editors and it has both a trial and paid version.

PhysicsEditor

As mentioned in the preceding section, PhysicsEditor is a popular and powerful tool to define collision shapes, especially when working with concave polygons or shapes.

We saw when talking about CCPhysicsShape that it can create convex polygons by an array of points, but what's the difference between convex and concave polygons?

A convex polygon is a simple polygon defined...