Hello I am making a cocos2d side scroller. I am using a plist file to supply my game data. For some reason the code is not reading the plist file and when I want to display an image, and the image is in the plist file, then I get a SIGABRT error.
Here is the plist file:
This is the code that is causing the error:
+(id)createRedEnemyWithDictionary:(NSDictionary *)redEnemyDictionary{
return [[[self alloc]initWithDictionary:(NSDictionary*)redEnemyDictionary]autorelease];
}
-(id)initWithDictionary:(NSDictionary*)redEnemyDictionary{
if ((self = [super init])) {
//Make the redEnemy
redEnemySprite = [CCSprite spriteWithFile:[redEnemyDictionary objectForKey:@"RedEnemyBaseImage"]];
[self addChild:redEnemySprite];
This is the error I am getting:
*** Assertion failure in -[CCSprite initWithFile:]
This is the line of code my exception breakpoint points to:
NSAssert(filename != nil, @"Invalid filename for sprite");