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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:01:28+00:00 2026-05-31T20:01:28+00:00

I am working on a game for iOS and I have to schedule an

  • 0

I am working on a game for iOS and I have to schedule an NSMutableArray addobject to be able to see my animation.

[monster stopAllActions];
[monster startDeathAction];
[monsterToDelete addObject: lilMonster];

I stop all actions on the monster object, then start the death animation and then I insert it into an array to delete it. The fact is that I cannot see the animation because it instant-deletes the monster.

I have been trying to schedule that addObject but I cannot find a way to do it.

Can I have some help from you? Thanks 🙂

In short: i want to wait an animation to finish to do a [array addObject: object];

PS: I didn’t mention it. I am working with Cocos2d

  • 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-31T20:01:30+00:00Added an answer on May 31, 2026 at 8:01 pm

    You have two options here:

    OPTION 1:Add a variable to monster that will basically tell if it’s death action has finished. Set it to true when you want to delete it. You’ll also have to modify the code that cleans up the monstersToDelete array to only delete the monsters that have their death action finished.

    OPTION 2: Make the monster call a delegate when the death action is done. Something like:

    - (void) startDeathAction : (id) target : (SEL) sel
    {
       Action* myCurrentAction = ...// your death action here
       [self runAction:[CCSequenceAction actionWithActions: myCurrentAction,[CCCallFunc actionWithTarget: target selector:sel ]];
    }
    

    and on the code where you are starting the death action add

    [monster stopAllActions];
    [monster startDeathAction: self : @selector(onMonsterDeath)];
    ...
    - (void) onMonsterDeath
    {
        [monsterToDelete addObject: lilMonster];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have been working on a Tower Defense game for iOS for some time now.
I have a game that I've been working on for iOS. We let our
I'm working on an iOS game. I have access to mac, xcode, etc. The
I'm working on a game engine in C++ and I have methods like setColour
Hey guys, I have a raidan style 2d flying/fighter game that im working on.
I'm working on a multiplatform game (PC/iOS/Android) and was looking into using Facebook as
I have a working trivia game and am now trying to implement a highscores.
Okay, so I have this partially working game, I know the solutions should be
I have written a simple, working tetris game with each block as an instance
I'm working on an iOS game where we create an OpenAL context on startup

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.