Pick Instance

Get help using Construct 2

Post » Wed Jan 16, 2013 4:05 am

You got it right.

The condition "Pick by UID" does the picking. The actions then does the logic (in that case indeed, destroying the picked instance).

In the game you want to make, instead of destroying you'll rather want to set the sprite invisible (as in your HUD the number of elements will be fixed and always appearing at the same position, so spawn them on start of layout and use the dictionary to keep the UID of each HUD instance you need to change the state during gameplay.
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,998
Reputation: 57,791

Post » Wed Jan 16, 2013 4:18 am

Ah ha! It's all becoming clearer. Thank you for the example!!
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Post » Wed Jan 16, 2013 12:21 pm

Oh ! Kyatric did it :D ... Oh well ... Next Time !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Wed Jan 16, 2013 2:06 pm

haha Thanks anyways Whiteclaws. :)
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Post » Thu Jan 17, 2013 3:22 am

I'm digging the dictionary and UID functionality.

One question:
Am I able to use a single dictionary to hold multiple object/sprite UID's or is it best to just use a separate dictionary per object?
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Post » Thu Jan 24, 2013 2:39 pm

I figured since Kyatric helped point in the right direction, that I would share how I implemented the use of a dictionary. Perhaps someone will find this useful as I did :)

I simplified it best I could:

-Player can collect set number of items statically placed on level by colliding and setting item invisible.
-HUD shows number of items collected (in animation form)
-Collide with enemy and last item collected is taken away and set visible AND HUD will take away last collection as well

Link to file - http://dl.dropbox.com/u/58760772/itemCollect.capxfacecjf2013-01-24 14:41:05
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Previous

Return to How do I....?

Who is online

Users browsing this forum: Ahr Ech, Baidu [Spider], benajad, Braus, R0J0hound, shinkan and 19 guests