Monday, 19 August 2013

im having problems with nstimer in Xcode

im having problems with nstimer in Xcode

im making a simple game on Xcode and i decided to use a nstimer in my .m
xcode found 3 problems with my code it says Assigning to 'CGPoint' (aka
'struct CGPoint') from in compatable 'int' twice and it says use of
undeclared game loop. Any help is great
enter code here
@implementation ViewController @synthesize bg, rock, platform1, platform2,
platform3, platform4, platform5, platform6, platform7; @synthesize
gameState; @synthesize rockVelocity, gravity;
// Implement viewDidLoad to do additional setup after loading the view,
typically from a nib.
(void)viewDidLoad { [super viewDidLoad]; gameState = kStateRunning;
rockVelocity = CGpointMake (0, 0); gravity = CGpointMake (0, kGravity);
[NSTimer scheduledTimerWithTimeInterval: 1.0/60 target:self
selector:@selector(gameLoop) userInfo:nil repeats:YES];
(void)gameLoop { if (gameState == kStateRunning) { [self
gameStatePlayNormal]; } else if (gameState == kStateGameOver) {
} }

No comments:

Post a Comment