我已經創建了簡單的遊戲。我怎樣才能提高球的速度。請幫忙!增加球(物體)速度
- (無效){BallMovement
[self ComputerMovement]; [self Collision]; football.center = CGPointMake(football.center.x + X, football.center.y + Y); if (football.center.x < 15) { X = 0 - X; } if (football.center.x > 305) { X = 0 - X; } if (football.center.y < 0) { PlayerScoreNumber = PlayerScoreNumber + 1; PlayerScore.text = [NSString stringWithFormat:@"%i", PlayerScoreNumber]; [timer invalidate]; StartButton.hidden = NO; button.hidden = NO; football.center = CGPointMake(147, 250);
謝謝,但直到不超速。不知道我做錯了什麼。 – mimi
嘗試x = x + 3;並添加它作爲第一行在該方法 – santhu
謝謝,但它仍然無法正常工作:((( – mimi