so I have a label and I would like that when an image collide with another image it increase of 10 . score = score +10; but instead of this it increase of 40 I don't know why . so here is my code :
-(id) init
{
if( (self=[super init] )) {
[self schedule:@selector(update:)];
score = 0;
scoreLabel = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"%d",score] fontName:@"PUSAB___.TTF" fontSize:15 ];
scoreLabel.position=ccp(450,30);
[self addChild:scoreLabel];
}
}
- (void)update:(ccTime)dt {
if (CGRectIntersectsRect(mangeurRect, targetRect)) {
[targetsToDelete addObject:target];
score=score + 10; ;// Not really, but your score changes somehow...
[scoreLabel setString: [NSString stringWithFormat:@"%d",score]];
}
}
sorry for my english I'm french :/