Creating a top-down isometric game engine

By making some modifications to Box2D we can turn a 2D world into a 2.5D world. We will see this 2.5D sandbox in action in this recipe.

Creating a top-down isometric game engine

Getting ready

Please refer to the project RecipeCollection02 for full working code of this recipe. Also note that a large amount of code from this recipe has been omitted for brevity.

How to do it...

Execute the following code:

@interface GameIsoObject : GameObject { @public float yModifier; //This is typically half the height of the object. It allows us to change the sprite y. float actualImageSize; //This is the actual size of the image (48x48, 96x96, etc) float inGameSize; ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.