0
我有一個xcode項目,與下面的代碼是:Xcode的整數++加入4
在fflayer.hINT * ffinjar;
在fflayer.m
-(void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {
CGSize winSize = [[CCDirector sharedDirector] winSize];
CGPoint touchLocation = [self convertTouchtoNodeSpace:touch];
CGPoint oldTouchLocation = [touch previousLocationInView:touch.view];
oldTouchLocation = [CCDirector sharedDirector] convertToGL:oldLocation];
oldTouchLocation = [self convertoToNodeSpace:oldTouchLocation];
CGPoint translation = ccpSub(touchLocation, oldTouchLocation);
[self panForTranslation:translation];
if (CGRectIntersectsRect(selSprite.boundingBox, eJar.boundingBox)) {
selSprite.userData = FALSE;
selSprite.visible = FALSE;
selSprite.position = ccp(winSize.width +40, winSize.height + 40);
_currentFlies--;
ffinjar++;
}
出於某種原因,這會導致ffinjar增加4而不是1,但_currentFlies只是減去1。我不知道。任何人都可以看到我可能做錯了什麼?
你在死了。非常感謝。 – user1415635
樂於助人;歡迎來到SO! –