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

The Archive Base Latest Questions

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

i have this game like doodlejump i inserted some monsters and bullets on the

  • 0

i have this game like doodlejump

i inserted some monsters and bullets on the player

the player fires a bullet and deletes the target

i inserted a nslog to both so i know if the bullet fires and the target shows

all is working smooth in the simulator ios 4.0

but when everytime i install it on the device

the bullet and the target seems to be not appearing(yes only those two the game is still running smooth)

but everytime i check the console i can see the nslog of the bullet and target

i tried it on 3 different phones ios 4.0, 5.0 and 4.2

now im confused if what seems to be the problem

i checked for same issues at google but i cant seem to find one

i also checked for spellings and mini problems but still it is occurring.

What seems to be causing this issue?


PS:the app im working on is outdated,it is old version of COCOS2d. does this
affect it? i tried on upgrading but i have so many errors that i dont
know thats why i go back to the default.


The Monsters are appearing for about .5 sec then will disappear suddenly is this because of the spriteMoveFinished?

here are the codes(target):

-(void)addTarget {

    Sprite *target =[Sprite spriteWithFile:@"him.png"];


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

    target.position = ccp(actualX,500);
    NSLog(@"Location:%f",target.position);
    [self addChild:target];

    int minDuration = 2.0; int maxDuration = 4.0;
    int rangeDuration = maxDuration - minDuration;
    int actualDuration = (arc4random() % rangeDuration)+minDuration;

    id actionMove = [MoveTo actionWithDuration:actualDuration position:ccp(actualX, -target.contentSize.height/2)];
    id actionMoveDone = [CallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
    [target runAction:[Sequence actions:actionMove,actionMoveDone, nil]];   
    target.tag = 1;
    [_targets addObject:target];
}

(bullets):

-(void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    AtlasSpriteManager *spriteManager = (AtlasSpriteManager*)[self getChildByTag:kSpriteManager];
    AtlasSprite *bird = (AtlasSprite*)[spriteManager getChildByTag:kBird];

    UITouch *touch = [touches anyObject];
    CGPoint location = [touch locationInView:[touch view]];
    location = [[Director sharedDirector]convertCoordinate:location];


    Sprite *projectile = [Sprite spriteWithFile:@"psn.png"];

    projectile.position = ccp(bird.position.x,bird.position.y);

    CGSize winSize = [[Director sharedDirector]winSize];

    int offX = location.x - projectile.position.x;
    int offY = location.y - projectile.position.y;

    [self addChild:projectile];

    float scalarX = 1.0f;
    if(offX < 0.0f) scalarX = -1.0f;
    int realX = scalarX * (winSize.width + (projectile.contentSize.width/2));
    float ratio = (float) offY / (float) offX;
    int realY = (realX *ratio) +projectile.position.y;
    CGPoint realDest = ccp(realX,realY);

    int offRealX = realX - projectile.position.x;
    int offRealY = realY - projectile.position.y;
    float length = sqrtf((offRealX*offRealX)+(offRealY*offRealY));
    float velocity = 480/1;
    float realMoveDuration = length/velocity;

    [projectile runAction:[Sequence actions:[MoveTo actionWithDuration:realMoveDuration position:realDest],
                           [CallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)], nil]];
    NSLog(@"Shoot!");
    projectile.tag = 2;
    [_projectiles addObject:projectile];


}

Thanks i hope this will be resolved…

  • 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-28T04:20:04+00:00Added an answer on May 28, 2026 at 4:20 am

    Odd. Things to try quickly would be:

    • Delete the app from the device itself (hold on the app icon until the ‘x’ appears and delete it) then do a clean build. This will force all assets to be replaced on the phone.

    • Do you have retina support enabled? If so, is there a file in your resources called ‘him-hd.png’ that is corrupt? It would try to load that one first if a retina device is detected.

    • Does it fail on the simulator for a retina device? You can change the device being simulated in the iOSSimulator menu bar.

    • When you added the images to the project, did you select ‘Copy items into destination group’s folder (if needed)? This is important as otherwise the images won’t be included with the bundle

    • Finally, did you check the Target Membership for the images so it is set to the app target? You can check this by selecting the image in xCode and looking at the File Inspector->Target Membership. There should be a check next to your application.

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

Sidebar

Related Questions

I have code like this to move the player in my game left, right,
Hi i have some movieclips like this one: game_mc.substage_mc.rightHand and inside the rightHand i
I'm designing a game server and I have never done anything like this before.
I have this game where balloons are coming from bottom and player has to
I have this game with some variety of textures. Whenever I draw a texture
I have a class with the only constructor like this: IntroScreen::IntroScreen(Game *game) : View(game),
I have this issue when I would like to go the Game Over screen.
I have to compile a game like this love C:\testgame in the cmd. So
I have a DB in which looks like this: Game ---------------- WinningID (FK) LoosingID
I am thinking of developing of a game like this: http://www.newgrounds.com/portal/view/429799 Do you have

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.