Game Development Reference
In-Depth Information
return self;
-(void) dealloc
CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
Now you can safely delete the HelloWorldLayer class. When asked, select the
Move to Trash option to remove the file from the hard drive as well, not just from the
Xcode project. Select both HelloWorldLayer files and choose Edit
Delete, or
right-click the files and choose Delete from the context menu.
Kobold2D users now only need to open the config.lua file in the Resources group
and change the FirstSceneClassName entry to read:
FirstSceneClassName = "GameLayer",
That's all. But in a purely cocos2d app, you have to modify AppDelegate.m and re-
place any references to HelloWorldLayer with GameLayer . Listing 4-3 high-
lights the necessary changes to the #import and pushScene statements if you're
not using Kobold2D.
Listing 4-3 . Changing the AppDelegate.m Fil to Use the GameLayer Class Instead of
// replace the line #import "HelloWorldLayer.h" with this one:
#import "GameLayer.h"
- (BOOL)application:(UIApplication *)application ← didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
. . .
// replace HelloWorldLayer with GameLayer
[director_ pushScene:[GameLayer scene]];
Search Nedrilad ::

Custom Search