How to destroy multiple objects?

0 favourites
  • 7 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello fellow constructers, it's my second day using the software and I've encountered a problem I can't seem to solve.

    My first game has golden goblets accompanied with a particle sparkle effect.

    When the player clicks on the golden goblet (if he is near enough), it disappears and adds 75 to the score.

    I also want to make the particle effect go away, but when I do it like this: puu.sh/1cYfN - it destroys all of the particle sprites in the whole game.

    How do I make it so it only destroys the particle that is linked to the goblet? Is there a way to link the two together locally?

    I tried making "destroy shine" seperately, but then it is possible for the player to only destroy the particles and the goblet will stay.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please post your CAPX

  • filedropper.com/asi

    I don't know why you need the file, though. The only thing necessary is in the "puush" screenshot.

  • You might need to have a look at the For Each ( Located under System > For Each) this way it'll do the action and checking for each instanc of the sprite.

  • filedropper.com/asi

    I don't know why you need the file, though. The only thing necessary is in the "puush" screenshot.

    ...you are the one asking for help...

    OK, I was not able to reproduce what you have said, but when I enlarged the particles you are talking about, it looked like they were only attached to a single goblet.

    What you are describing sounds like a picking problem and within your code, you are checking the distance of your avatar to the goblet, but you do not pick the coresponding "shine".

  • > filedropper.com/asi

    >

    > I don't know why you need the file, though. The only thing necessary is in the "puush" screenshot.

    ...you are the one asking for help...

    OK, I was not able to reproduce what you have said, but when I enlarged the particles you are talking about, it looked like they were only attached to a single goblet.

    What you are describing sounds like a picking problem and within your code, you are checking the distance of your avatar to the goblet, but you do not pick the corresponding "shine".

    Thanks for the help. I originally thought that maybe it was a simple thing I only needed to add to the "left click on goblet" instance, hence the screenshot. But it seems to be a bigger thing so I'll need to learn more about this "picking" thing.

    And to the previous guy, the "For each" thing didn't help, I'm afraid.

  • This is a friendly board and there are many members who are willing and able to help. You seem to be young to c2, so maybe sometimes it would be wise, just to "listen" to the elder. No one wants to steal your code, or your idea, but seeing the code in question just makes it so much easier to help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)