Hello, first off, I'm new to the forum and, more importantly, writing C++ and working with the iPhone SDK.
I was wondering if anybody could help me - I'm really eager to keep learning, and everything has been okay until now. I'm getting an error that I can't resolve, no matter what I do...
The line it appears on is no. 33 ( if(puc.center.y <= self.view.center.y) { ), and the error message reads:
"Expected identifier or '(' before 'if'"
///////////////////////////////////////////////////////////////////////BEGIN SECTION
-(void) gameLoop {
if(gameState == kGameStateRunning) {
puc.center = CGPointMake(puc.center.x + pucVelocity.x , puc.center.y + pucVelocity.y);
if(puc.center.x > self.view.bounds.size.width || puc.center.x < 0) {
pucVelocity.x = -pucVelocity.x;
}
if(puc.center.y > self.view.bounds.size.height || puc.center.y < 0) {
pucVelocity.y = -pucVelocity.y;
}
} else {
if (tapToBegin.hidden) {
tapToBegin.hidden = NO;
}
}
if(CGRectIntersectsRect(puc.frame,paddleblue.frame)) {
if(puc.center.y < paddleblue.center.y) {
pucVelocity.y = -pucVelocity.y;
}
}
if(CGRectIntersectsRect(puc.frame,paddlegreen.frame)) {
if(puc.center.y > paddlegreen.center.y) {
pucVelocity.y = -pucVelocity.y;
}
}
if(puc.center.y <= self.view.center.y) {
if(puc.center.x < paddlegreen.center.x) {
CGPoint compLocation = CGPointMake(paddlegreen.center.x - kCompMoveSpeed, paddlegreen.center.y);
paddlegreen.center = compLocation;
}
if(puc.center.x > paddlegreen.center.x) {
CGPoint compLocation = CGPointMake(paddlegreen.center.x + kCompMoveSpeed, paddlegreen.center.y);
paddlegreen.center = compLocation;
}
}
}
///////////////////////////////////////////////////////////////////////END SECTION
Thank-you in advance, and I hope you can help - my efforts so far have proved fruitless!