Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:45:25+00:00 2026-06-03T14:45:25+00:00

I try to use a few functions in my GameLayer. First – from another

  • 0

I try to use a few functions in my GameLayer. First – from another class, second – from GameLayer class, but CCSequence run like CCSpawn, not sequence. Separately they both work perfect in GameLayer.

in GameLayer

    [self runAction:[CCSequence actions:
                    [CCCallFuncN actionWithTarget:self.rolypoly selector:@selector(jumpToDeath:)],
                    [CCCallFuncND actionWithTarget:self selector:@selector(goToGameOverLayer:tagName:)data:(int)TagGameOverLose],     
                     nil]];

in rolypoly class

-(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)], 
                              nil]];


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:45:26+00:00Added an answer on June 3, 2026 at 2:45 pm

    The problems is that the runAction is not a blocking method. Meaning that when you use a function call action (like CCCallFunc) the action after it in the sequence will be executed when the function call returns. In your case jumpToDeath 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 jumpToDeath is finished)

    Try to rearrange your actions. If you need more help let me know.

    EDIT : My suggestion :

     [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]];
    }
    

    As you can see I moved the last call function action to be the last in the jumpToDeath method which insures it will be executed last after all other actions are done.

    I do not know what is the implementation of moveSpriteDeath but if it does not contain actions than it will be ok, otherwise show its implementation or try doing the same

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to use doctest from example from http://docs.python.org/library/doctest.html But when I run python
I try use string as a regular expression pattern but I've following errors PHP
I try to use the winDBG to debug a dump file. When I run
I try to use PHPMailer to send registration, activation. etc mail to users: require(class.phpmailer.php);
I try to use the SQL statement SELECT * FROM table ORDER BY column
When I use some of php's encryption functions, I end up getting a few
I have seen a few examples of Haskell code that use functions in parameters,
I have project that shows few tables and try to use JQuery dialog boxes
I have a few tables that I've defined like the below examples: class TableA
I try use a integer array in java with the code below: public static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.