ccfollowアクションが正しく発射されています。ダブルタップが認識されたとき。cocos2dのccfollowアクション
以下のコードを参照してください。間違っていた。
がここに私のコードです: - 上記のコードを見た後
- (void)update:(ccTime)dt {
if (numTaps==1) {
[self runAction:[CCFollow actionWithTarget:nextProjectile worldBoundary:CGRectMake(0,0,1050,350)]];
}
}
- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
numTaps = [[touches anyObject] tapCount];
printf("Tapcount : %d",numTaps);
if (numTaps ==1) {
nextProjectile = [[CCSprite spriteWithFile:@"Weapon.png"] retain];
nextProjectile.position = ccp(nextprojectile .contentSize.width/2+65, nextprojectile.contentSize.height/2+70);
[nextProjectile runAction:[CCSequence actions: [here's my nextprojectile actions],nil]];
}
}
。あなたによって提起された質問。 なぜif条件でccfollowアクションに言及していますか?
ここでは、 通常、更新機能では動作しませんが、ダブルタップを認識した後にこの条件を設定すると動作します。
この問題を解決するにはどうすればよいですか?
ご協力いただければ幸いです。
よろしいですか?ありがとう – Sri