Game Development Reference
In-Depth Information
The main.m file is the entry point for each application; it contains the main method.
The Kobold2D implementation simply calls its internal method KKMain :
#import "kobold2d.h"
int main(int argc, char *argv[])
{
return KKMain(argc, argv, NULL);
}
KKMain takes both argc and argv arguments and a third, optional parameter that
can be used to pass additional parameters to the start-up process if needed. Because
that's rarely, if ever, needed, you can just pass NULL . KKMain hides the complexity of
launching the app for either the iOS or Mac OS platform. It also initializes Lua and
parses the config.lua file, which provides app configuration settings. I discuss the
config.lua file in the next section.
At this point, it makes sense to show you the AppDelegate class of a Kobold2D
project, or, rather, what's left of it. Here's the interface:
#import "KKAppDelegate.h"
@interface AppDelegate : KKAppDelegate
{
}
@end
Nothing there. Maybe there's more in the implementation part of the app delegate?
#import "AppDelegate.h"
@implementation AppDelegate
// Called when Cocos2D is fully setup and you are able to run the first scene
-(void) initializationComplete
{
}
@end
Nope. I can already hear you: dude, where's my app delegate?
Search Nedrilad ::




Custom Search