How to destroy multiple objects?

Get help using Construct 2

Post » Tue Oct 09, 2012 12:34 pm

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: http://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.Garrett2012-10-09 12:48:06
B
2
Posts: 3
Reputation: 256

Post » Tue Oct 09, 2012 12:38 pm

Please post your CAPX
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Oct 09, 2012 12:44 pm

http://www.filedropper.com/asi

I don't know why you need the file, though. The only thing necessary is in the "puush" screenshot.Garrett2012-10-09 12:46:20
B
2
Posts: 3
Reputation: 256

Post » Tue Oct 09, 2012 1:06 pm

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.
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125

Post » Tue Oct 09, 2012 4:52 pm

[QUOTE=Garrett] http://www.filedropper.com/asi

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

...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".Weishaupt2012-10-09 17:08:45
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Oct 09, 2012 8:04 pm

[QUOTE=Weishaupt] [QUOTE=Garrett] http://www.filedropper.com/asi

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

...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".[/QUOTE]

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.
B
2
Posts: 3
Reputation: 256

Post » Wed Oct 10, 2012 7:27 am

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.Weishaupt2012-10-10 07:28:28
B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests