Game Development Reference
In-Depth Information
Figure 5-1 . The ScenesAndLayers04 project. So far, so normal
Start by putting the MultiLayerScene together in the init method. If you skim
over the code in Listing 5-4 , you'll barely notice anything different from what we've
done so far.
Listing 5-4. Initializing the MultiLayerScene
-(id) init
if ((self = [super init]))
sharedMultiLayerScene = self;
// The GameLayer will be moved, rotated and scaled independently
GameLayer* gameLayer = [GameLayer node];
[self addChild:gameLayer z:1 tag:LayerTagGameLayer];
gameLayerPosition = gameLayer.position;
// The UserInterfaceLayer remains static and relative to the screen area.
UserInterfaceLayer* uiLayer = [UserInterfaceLayer node];
[self addChild:uiLayer z:2 tag:LayerTagUserInterfaceLayer];
return self;
Search Nedrilad ::

Custom Search