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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:03:02+00:00 2026-05-28T08:03:02+00:00

I have sprites which are spawning from bottom to top. They are coming randomly

  • 0

I have sprites which are spawning from bottom to top. They are coming randomly and i haven’t used spritesheet for this. The problem is they flicker during their movement from bottom to top. How can i overcome this problem? I am using cocos2d 1.0.1. Thanks for any help.

// Determine where to spawn the target along the X axis

    CGSize winSize = [[CCDirector sharedDirector] winSize];
    int minX = target.contentSize.width/2;
    //  int maxX = winSize.width - target.contentSize.width/2;
    //  int rangeX = maxX - minX;
    int actualX = (arc4random() % 230) + minX;

    // Create the target slightly off-screen along the right edge,
    // and along a random position along the Y axis as calculated above
    target.position = ccp(actualX,-100);
    [self addChild:target];

    // Determine speed of the target
    float minDuration = 4.0;
    float maxDuration = 12.0;
    float rangeDuration = maxDuration - minDuration;
    //int actualDuration = (arc4random() % rangeDuration) + minDuration;

    // Create the actions
    id actionMove = [CCMoveTo actionWithDuration:rangeDuration position:ccp(actualX,winSize.height+target.contentSize.height)];

    [target runAction:[CCSequence actions:actionMove, 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-05-28T08:03:02+00:00Added an answer on May 28, 2026 at 8:03 am

    In appdelegate I increased FPS and the sprite movements were smooth. I replaced

    [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; with

    [[CCDirector sharedDirector] setAnimationInterval:0.5/60];

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

Sidebar

Related Questions

so I have this spritesheet (4 sprites in a row and 3 in a
I have a mutable array which stores sprites but the problem is that the
I have some images which I would like to use as sprites in my
First i have scaled the layer larger which contains the sprites. Now I need
I have a sprite in which I have added other sprites. Something like: var
This is quite hard to explain. I have a class which should support the
I have three sprites, stacked on top of each other. I modify their transform.matrix
I have 2 sprites which when drawn together make up the correct image on
i have many sprites in my game,which all have bodies in a b2world. and
I have a class called Projectiles which inherits from CCSprite class, Currently there are

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.