Now this is pretty weird. I got a method that will increase my score by 1 and then update my score label to reflect this,
But every time I run this method, the score is increased by 4 when it should be by 1! I have placed a breakpoint and it looks like this method is only called once... Or it seems so, I'm not sure if I checked correctly.
However, I am pretty sure this method is really only called once... Here is the method:
-(void) updateScore:(int)amount
{
points += amount;
NSString *msg = [[NSString alloc]initWithFormat:@"%d",points];
[score setString:msg];
[msg release];
}
points is a int defined in the header file, and initialized with 0 in the init method.
amount is an argument taken by the updateScore method. I have made sure the value is simply 1. Always.
score is the CCLabel.
What might be wrong? Every time I kill an enemy my score goes 4... 8... 12... 16... 20... >___>