[Solve] How to tell duplicate sprite to destroy.

Discussion and feedback on Construct 2

Post » Mon Oct 17, 2011 3:40 am

If I put heart icon represent player's life.

I drag one heart icon in the scene.
Hold Ctrl key and drag to make another 2 copies of it.

So it'll be 3 hearts in the scene.

I want to order destroy the heart 1,2,3.

How to do that, cause all the hearts have the same name.

When I put destroy heart, all of them will be gone.

imissu22011-10-17 04:27:03
B
3
G
1
Posts: 27
Reputation: 584

Post » Mon Oct 17, 2011 3:49 am

Set an instance variable (name "order" for example).
Make a condition, testing if the Heart object's instance variable is either 1, 2 or 3.
The destroy action will pick only the heart with the correct value.

Be sure to set a different value to each heart.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Oct 17, 2011 3:59 am

How to make subevent inside of event?

Right now it is like this.

MONSTER : On collision with Player | Player : subtract1 from P_Health
                                   | Monster : destroy
                                   | (how can I add condition here?)

B
3
G
1
Posts: 27
Reputation: 584

Post » Mon Oct 17, 2011 4:27 am

I got it, thank you so much, Kyatric.
B
3
G
1
Posts: 27
Reputation: 584


Return to Construct 2 General

Who is online

Users browsing this forum: MilkGames and 12 guests