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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:45:23+00:00 2026-06-18T15:45:23+00:00

I’m trying to develop an iphone game with cocos2d and I’m a beginner. I

  • 0

I’m trying to develop an iphone game with cocos2d and I’m a beginner.
I have some problems trying to show the number of lives in the upper boundary of the screen. So I want to start with 3 lives and decrease one of them at each error. This is my code

-(void)life {
    NSMutableArray *position = [NSMutableArray
                                arrayWithObjects:@"460", @"440", @"420", nil];
    spriteLifeArray = [[NSMutableArray alloc] init];
    for (int i = 0; i<life; i++) {
        spriteLife = [CCSprite spriteWithSpriteFrameName:@"cuore.png"];
        [spriteLife setTag:i];
        spriteLife.scale = 0.5;
        spriteLife.position = ccp([[position objectAtIndex:i] floatValue], 305);
        [self addChild:spriteLife];
        [spriteLifeArray addObject:spriteLife];
    }
}

and this is my function for the gameover and the the life removing

-(void)gameOver:(int)value punteggio:(id)punti{
    if (value == 1) {
        // partita vinta
    } else if(value == 2) {
        if (life > 1) { // 1
            life = life - 1;
            for (CCSprite *spr in spriteLifeArray) {
                if (life == spr.tag) {
                    [self removeChild:spr cleanup:YES];
                    [self actionBlink];
                }
            }
        } else { 
            //  partita persa
        }
    }
}

A file named “cuore.png” exists in the Resources Folder, But when I try to compile, after the splashscreen the app crashes. This is the log:

2013-02-11 19:55:06.635 QuizGame[6672:c07] cocos2d: cocos2d v1.0.1
2013-02-11 19:55:06.636 QuizGame[6672:c07] cocos2d: Using Director
Type:CCDirectorDisplayLink 2013-02-11 19:55:06.664 QuizGame[6672:c07]
cocos2d: OS version: 6.1 (0x06010000) 2013-02-11 19:55:06.664
QuizGame[6672:c07] cocos2d: GL_VENDOR: Apple Computer, Inc.
2013-02-11 19:55:06.665 QuizGame[6672:c07] cocos2d: GL_RENDERER: Apple
Software Renderer 2013-02-11 19:55:06.666 QuizGame[6672:c07] cocos2d:
GL_VERSION: OpenGL ES-CM 1.1 APPLE 2013-02-11 19:55:06.667
QuizGame[6672:c07] cocos2d: GL_MAX_TEXTURE_SIZE: 4096 2013-02-11
19:55:06.667 QuizGame[6672:c07] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH:
16 2013-02-11 19:55:06.667 QuizGame[6672:c07] cocos2d: GL_MAX_SAMPLES:
4 2013-02-11 19:55:06.668 QuizGame[6672:c07] cocos2d: GL supports
PVRTC: YES 2013-02-11 19:55:06.668 QuizGame[6672:c07] cocos2d: GL
supports BGRA8888 textures: YES 2013-02-11 19:55:06.669
QuizGame[6672:c07] cocos2d: GL supports NPOT textures: YES 2013-02-11
19:55:06.670 QuizGame[6672:c07] cocos2d: GL supports
discard_framebuffer: YES 2013-02-11 19:55:06.670 QuizGame[6672:c07]
cocos2d: compiled with NPOT support: NO 2013-02-11 19:55:06.671
QuizGame[6672:c07] cocos2d: compiled with VBO support in TextureAtlas
: YES 2013-02-11 19:55:06.671 QuizGame[6672:c07] cocos2d: compiled
with Affine Matrix transformation in CCNode : YES 2013-02-11
19:55:06.672 QuizGame[6672:c07] cocos2d: compiled with Profiling
Support: NO 2013-02-11 19:55:06.695 QuizGame[6672:c07] cocos2d:
CCSpriteFrameCache: Frame ‘cuore.png’ not found 2013-02-11
19:55:06.695 QuizGame[6672:c07] * Assertion failure in +[CCSprite
spriteWithSpriteFrameName:],
/Users/alexbava/Desktop/QuizGame/QuizGame/libs/cocos2d/CCSprite.m:110
2013-02-11 19:55:06.696 QuizGame[6672:c07]
Terminating app due to
uncaught exception ‘NSInternalInconsistencyException’, reason:
‘Invalid spriteFrameName: cuore.png’
*
* First throw call stack: (0x2074012 0x1ca4e7e 0x2073e78 0x14e7665 0x6564e 0xc2bd7 0xc3229 0x40261 0xc1c4d 0xc12ec 0x9931af 0x9937a1
0x99494b 0x9a5cb5 0x9a6beb 0x998698 0x2d7cdf9 0x2d7cad0 0x1fe9bf5
0x1fe9962 0x201abb6 0x2019f44 0x2019e1b 0x99417a 0x995ffc 0xc0dcf
0x2665) libc++abi.dylib: terminate called throwing an exception (lldb)

I think I’ve made a stupid error or something missing. Can anyone help me please?

  • 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-18T15:45:24+00:00Added an answer on June 18, 2026 at 3:45 pm

    the CCSprite constructor you took will look for a CCSpriteFrame object in the CCSpriteFrame cache. If you juste wanted to create a sprite from a file named ‘cuore.png’ use the constructor :

    CCSprite * spriteLife = [CCSprite spriteWithFile:@"cuore.png"];
    

    Sprite frames are typically used for animations, or managing large texture atlases that contain many (and sometimes unrelated) textures.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,

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.