Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problems is that the <code>runAction</code> is not a blocking method. Meaning that when you use a function call action (like <code>CCCallFunc</code>) the action after it in the sequence will be executed when the function call returns. In your case <code>jumpToDeath</code> runs actions but does not wait for them to be finished and when it returns the second action in your main sequence is executed (before the sequence inside <code>jumpToDeath</code> is finished) </p> <p>Try to rearrange your actions. If you need more help let me know.</p> <p><strong>EDIT :</strong> My suggestion :</p> <pre><code> [self runAction:[CCSequence actions: [CCCallFuncN actionWithTarget:self.rolypoly selector:@selector(jumpToDeath:)], nil]]; -(void)jumpToDeath:(id)sender { [self.sprite stopAllActions]; id actionSpaw = [CCSpawn actions: [CCMoveTo actionWithDuration:0.5f position:ccp(self.sprite.position.x, self.sprite.position.y+self.sprite.contentSize.height)], [CCBlink actionWithDuration:1.0f blinks:4], nil]; [self.sprite runAction:[CCSequence actions: [CCCallFuncND actionWithTarget:self selector:@selector(setJumpingToDeath:withValue:)data:(void*)1], actionSpaw, [CCHide action], [CCCallFunc actionWithTarget:self selector:@selector(moveSpriteDeath)], [CCCallFuncND actionWithTarget:self selector:@selector(goToGameOverLayer:tagName:)data:(int)TagGameOverLose], nil]]; } </code></pre> <p>As you can see I moved the last call function action to be the last in the <code>jumpToDeath</code> method which insures it will be executed last after all other actions are done.</p> <p>I do not know what is the implementation of <code>moveSpriteDeath</code> but if it does not contain actions than it will be ok, otherwise show its implementation or try doing the same</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload