Game Development Reference
In-Depth Information
-(id) init
{
self = [super init];
if (self)
{
self.isTouchEnabled = YES;
CCSpriteBatchNode* batchNode = [CCSpriteBatchNode ←
batchNodeWithFile:@"dg_grounds32.png"];
spriteTexture = batchNode.texture;
[self addChild:batchNode z:0 tag:kTagBatchNode];
[self initPhysics];
CGSize screenSize = [CCDirector sharedDirector].winSize;
[self addNewSpriteAtPosition:ccp(screenSize.width / 2, screenSize.height / 2)];
CCLabelTTF* label = [CCLabelTTF labelWithString:@"Tap screen"
fontName:@"Marker Felt"
fontSize:32];
[self addChild:label z:0];
label.color = ccc3(0, 0, 255);
label.position = ccp(screenSize.width / 2, screenSize.height - 50);
[self scheduleUpdate];
}
return self;
}
-(void) dealloc
{
delete world;
world = NULL;
delete debugDraw;
debugDraw = NULL;
}
Search Nedrilad ::




Custom Search