Hi there, i have been in the process of learning objective C and I had gotten stuck on a rather easy problem I am sure. I am making a game. But I wanted to put all the game logic that wouldnt change between the levels in the same object. Called gamelogic.m But for some reason when I make the object then run its methods in my scene the methods seem to get skipped over. None of my break points in the gamelogic object get hit. Here are my definitions..
gamelogic.h
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "SpaceManager.h"
#import "cpSprite.h"
@interface gameLogic : NSObject {
}
- (void) sharkFearCheck: (cpShape*)shark shape: (cpShape*)person;
- (BOOL) callingTest;
@end
gamelogic.m
#import "gameLogic.h"
#import "cpConstraintNode.h"
#import "cpShapeNode.h"
@interface gameLogic (PrivateMethods)
@end
@implementation gameLogic
- (id) init
{
if ( self = [super init])
{
}
return self;
}
- (void) dealloc
{
[super dealloc];
}
- (BOOL) callingTest
{
return YES;
}
@end
Delcared in Gamelayer.h
gameLogic *gameRules;
And where its called...
GameLayer.m
BOOL runtest = [gameRules callingTest];
if (runtest == YES)
{
[label setString:@"IT RAN"];
}
else
{
[label setString:@"It didnt run!"];
}
I also tried declaring the object right before callingTest with.
gameLogic *gameRules = [gameLogic];
But I couldnt get it to work... so what am I doing wrong?