i am trying out a pong game to start out developing games on the the iphone and i've got everything moving but i need to implement the scoring and make the ball return to the center of the screen this is the code i have currently in the touchesBegan method:
if(ball.center.y >=444) {
computerScore=computerScore+1;
computerScoreLabel=[NSString stringWithFormat:@"%d", computer];
ball.center.x=151;
ball.center.y=222;
}
if(ball.center.y <=4) {
playerScore=playerScore+1;
playerScoreLabel=[NSString stringWithFormat:@"%d", player];
ball.center.x=151;
ball.center.y=222;
}
it builds correctly and runs, but when i try the game on the simulator it just makes the ball move around and when it passes the specific points it just bounces off and the score doesn't change