Hey all,
In my app I have a level class which draws everything to the screen. I also have a enemy class. I want to make the CCSprite in the enemy class and draw it onto the screen. My code doesn't error but it also doesn't draw my enemy. This is my code in enemyClass.m
-(void)initAllWithX:(int)x withY:(int)y withType:(NSString *)enemyType{
level *lvl;
CCSprite *enemy = [CCSprite spriteWithFile:[NSString stringWithFormat:@"%@.png", enemyType]];
ring.position = ccp(x, y);
[lvl addChild:enemy];
[lvl reorderChild:enemy z:10];
}
And in level.m
enemy1 = [[enemyClass alloc] init];
So is there a way to draw to the screen or add childs to level.m from enemyClass.m?
Thanks
Clinton