Creating a minimap
An engaging and informative in-game HUD is a crucial piece of most games. Mobile games, in particular, often blend user input with heads-up information due to the small amount of screen real estate available. In this example, we will create a Minimap to help the player navigate the terrain in the isometric game demo from the last chapter.
Getting ready
Please refer to the project RecipeCollection02 for full working code of this recipe.
How to do it...
Execute the following code:
#import "Minimap.h" @implementation Ch5_Minimap -(CCLayer*) runRecipe { //Initialize the Minimap object minimap = [[[Minimap alloc] init] autorelease]; minimap.position ...
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.