June 2014
Beginner to intermediate
434 pages
9h 49m
English
The parallax scrolling technique adds depth to your game by moving different layers placed one above each other at different speed. Let's use it in our TilemapScene class and you'll see what I'm talking about. Perform the following steps:
TilemapScene.m file and add the following instance variable:@implementation TilemapScene
{
//..skipped..
CCParallaxNode *_parallaxNode;
}addTilemap method and replace it with the following code:-(void)addTilemap { _tileMap = [CCTiledMap tiledMapWithFile:@"tilemap.tmx"]; _worldSize = _tileMap.contentSizeInPoints.width; //1 CCTiledMapLayer *bushes = [_tileMap layerNamed:@"Bushes"]; CCTiledMapLayer *trees = [_tileMap layerNamed:@"Trees"]; CCTiledMapLayer ...