mindgear's Recent Forum Activity

  • This would be really nice when you are refactoring/structuring your code.

  • > Here is your corrected example

    >

    > What's the point of spawning instances and destroying them in the same row anyway ?

    >

    > Also it had more to see with the order and how events work.

    There is no point! :-) It was just an example to illustrate that I got an unexpected result from performing a series of actions.

    If i create x object, iterate and destroy them, I should end up with zero objects. My example just demonstrates that this is not what happens.

    Here is a different version of my example that works.

    dl.dropbox.com/u/19522040/destroyProblem.capx

    I understand why this works, but I'm still puzzled that the first version did not.... Well Ill try to make this work in my game.... Thanks for the feedback/help.

  • Here is your corrected example

    What's the point of spawning instances and destroying them in the same row anyway ?

    Also it had more to see with the order and how events work.

    There is no point! :-) It was just an example to illustrate that I got an unexpected result from performing a series of actions.

    If i create x object, iterate and destroy them, I should end up with zero objects. My example just demonstrates that this is not what happens.

  • > Event for removing all instances.

    >

    > Add event (system --> pick all)

    > Choose instance.

    > Add action (destroy)

    >

    > If this wont work then posting a capx would be helpfull for those whith answers.

    >

    > Goodluck!

    Ill try to post an example..

    Here is an example:

    dl.dropbox.com/u/19522040/destroyProblem.capx

  • Event for removing all instances.

    Add event (system --> pick all)

    Choose instance.

    Add action (destroy)

    If this wont work then posting a capx would be helpfull for those whith answers.

    Goodluck!

    Ill try to post an example..

  • This removes the visually from the game, but if I do a For each "Object" -> someAction right after they are still there.

    So if I add 10 objects, foreach object destroy, add 10 object and finally foreach object something, the loop iterates 20 times, even thought I only see 10 objects on the screen.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have now tried several way to delete all instances of a object, but can't seem to get it to work.

    What is the best way to remove all instances of a object from the game.

    Example:

    The game of chess is over and and wanner remove all the pawns so I can insert them again for the next game.

mindgear's avatar

mindgear

Member since 25 Oct, 2011

None one is following mindgear yet!

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies