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

  • Home
  • SEARCH
  • 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 4029440
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:20:44+00:00 2026-05-20T11:20:44+00:00

i am using cocos2d and i have a for loop to create a bunch

  • 0

i am using cocos2d and i have a for loop to create a bunch of sprites, and i am running an action on every sprite in the forloop, however when i run the simulator i cant see the action ..some1 please help me

           CCAction * action = [CCSequence actions:[CCFadeIn actionWithDuration:2],nil];
           for(NSInteger lp = 0;lp<49;lp++)

    {
        float  sizer = [[numberOfElement objectAtIndex:lp]floatValue];




        CCSprite *_bar = [CCSprite spriteWithFile:colorOfBar rect:        (CGRectMake(10,20,5,sizer*30))];
        _bar.position = ccp(5+9.5*lp,((sizer*30)/2)+25);

        [self addChild:_bar z:1];

        [_bar runAction:action];


    }
  • 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-05-20T11:20:45+00:00Added an answer on May 20, 2026 at 11:20 am

    You need to create Action instance for each node.

    for(NSInteger lp = 0;lp<49;lp++)
    {
        float  sizer = [[numberOfElement objectAtIndex:lp]floatValue];
    
        CCSprite *_bar = [CCSprite spriteWithFile:colorOfBar rect:(CGRectMake(10,20,5,sizer*30))];
        _bar.position = ccp(5+9.5*lp,((sizer*30)/2)+25);
    
        [self addChild:_bar z:1];
    
        CCAction * action = [CCSequence actions:[CCFadeIn actionWithDuration:2],nil];
        [_bar runAction:action];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using cocos2d and having many sprites and bodies. each sprite has its
I'm using the cocos2d framework for various of my applications, and have run into
i'm using cocos2d, however the question is general. i have a class CCNode *scaleLayer
i have an app using cocos2d, Im moving some sprites and having animations when
In a game that I am making whilst using Cocos2d, I have a sprite
I am using cocos2d-iphone to place Sprites onto a Layer to setup a game
I am trying to develop a iphone app by using cocos2d. I create a
I am considering using the excellent looking Cocos2d for a motion graphics project. However,
If I have two objects in chipmunk (I'm using cocos2d-iphone), once I've detected that
I'm using cocos2d with objective C. I have a class called CrystalineBubble that is

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.