Creating levels using JSONWorldBuilder
Creating a game level using tiles is a technique that works well for many games. In this recipe, however, we will create a level in a more non-linear fashion using the JSONWorldBuilder level editor.
Getting ready
Please refer to the project RecipeCollection03
for full working code of this recipe.
How to do it...
Execute the following code:
#import "ActualPath.h" #import "CJSONDeserializer.h" //Interface @interface Ch8_JSONWorldBuilder : GameArea2D { NSDictionary *mapData; CGPoint canvasSize; NSMutableArray *lineVerticesA; NSMutableArray *lineVerticesB; NSMutableArray *points; } @end //Implementation @implementation ...
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.