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 8667897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:04:49+00:00 2026-06-12T18:04:49+00:00

In cocos2d-x, I have encountered the following problem when trying to define a CCSequence

  • 0

In cocos2d-x, I have encountered the following problem when trying to define a CCSequence separately, i.e. not within runAction.

This works:

sprWheel1->runAction(   CCSequence::actions(
    CCDelayTime::actionWithDuration( fDelayTime ),
    CCEaseExponentialOut::actionWithAction( 
        CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
    NULL
) );
sprWheel2->runAction(   CCSequence::actions(
    CCDelayTime::actionWithDuration( fDelayTime ),
    CCEaseExponentialOut::actionWithAction( 
        CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
    NULL
) );

This does not work:

CCFiniteTimeAction* actRotate = CCSequence::actions(
    CCDelayTime::actionWithDuration( fDelayTime ),
    CCEaseExponentialOut::actionWithAction( 
        CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
    NULL
);

sprWheel1->runAction( actRotate );
sprWheel2->runAction( actRotate );

It does not cause a compiler error, or crash, or anything, it just doesn’t rotate the sprite.

How can I fix this? (I am using this action multiple times, so it would really help to keep my code cleaner if I could define it only once)

  • 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-12T18:04:50+00:00Added an answer on June 12, 2026 at 6:04 pm

    A single instance of CCAction should not be used concurrently on multiple objects. The objects contained within the sequence maintain state on the current execution of the action, thus concurrent use on multiple objects will cause mayhem (cocos is possibly ‘guarding’ silently against that by stoping all actions, not certain). Best to have separate sequences for each sprite you want to animate. If you are concerned about code readability, just create a method in that class that will always return a fresh instance of the sequence.

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

Sidebar

Related Questions

i am having this problem try to use the cocos2d CCScrollLayer I have added
I'm currently building a game with cocos2d and I have the following Problem: I
I have just learnt Cocos2d, but i am not an expert on it. But
I have successfully implemented slider to my Cocos2D project using this resource . The
I have written my code in following way in cocos2d. id actionTo = [CCFadeOut
I have a game in the works in Cocos2d. I have enemies that spawn
ok i am new to coding and cocos2d i have this shooting code that
I'm currently building a game for the iPhone with cocos2d and have the following
I am developing a game using Cocos2d FrameWork in Android. I encountered a problem
I am using cocos2d and have the following code which moves my layer based

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.