Over the next few weeks I’m going to do some posts about the tools that we’re using to make Tasty Planet. I’m not talking about the commercial packages that we use like Photoshop and Visual Studio; I’m talking about the editors that I have created specifically to help build Tasty Planet 2.
In Tasty Planet 2, as in most other games, we need to know when objects are touching other each other. When the grey goo is rolling towards a cat, how do we know that the goo ball is actually touching the cat (so that we can consume to defenseless little creature)? In Tasty Planet 2 I’m using the Box2D physics system to answer this question, but we still need to tell Box2D what size and shape an object is. Enter the collision editor:
It’s a simple editor that lets us choose the object to edit from a list on the left (the taxi is chosen in this case), and then we can add circles and polygons using the buttons on the right. The green lines overlaid on the taxi show the collision area – if another objects green outline touches this object’s, then we know that they are colliding. If the object is complicated, we can use more than one shape. In the case of the taxi we are using an 8 sided polygon.
This isn’t all that different from Tasty Planet 1. One improvement is the use of convex polygons (in Tasty Planet 1 we were simply using rectangles). But the main improvement comes from the fact that we are using Box2D to detect and resolve collisions, so objects will behave in a more natural way when they collide with each other.