How do I take two objects from many?

Get help using Construct 2

Post » Sun Aug 09, 2015 11:36 am

Hello everyone,

Let me explain with an example:
I have 6 balls and every 2 seconds I would like 2 of these random become transparent

Is there a way to do this? Thank you
B
17
S
3
Posts: 62
Reputation: 1,054

Post » Sun Aug 09, 2015 11:44 am

try "Pick random instance" and instance variable
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Sun Aug 09, 2015 1:55 pm

@MadSpy Thanks for the answer but to take more than one random instance?
B
17
S
3
Posts: 62
Reputation: 1,054

Post » Sun Aug 09, 2015 2:08 pm

pick random instance of object with opacity=100 twice
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Sun Aug 09, 2015 3:31 pm

@MadSpy This works but most of the time it takes 2 times the same ball, how can I do?
B
17
S
3
Posts: 62
Reputation: 1,054

Post » Sun Aug 09, 2015 4:13 pm

you could use wait action between 2 pick or functions
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Sun Aug 09, 2015 4:45 pm

@MadSpy I've already tried, but only the first time work, after is completely at random..

Image

I also tried to slow down the second pick but nothing changes and in any case I would like that when 2 balls disappear, other two come back visible.
B
17
S
3
Posts: 62
Reputation: 1,054

Post » Sun Aug 09, 2015 5:02 pm

just a thought.. pickedUpTimer.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Aug 09, 2015 5:09 pm

@Fiammaoscura In your screenshot you are picking a random instance and THEN checking if it is 100%. You should swap those lines so it first picks the 100% balls, then picks one of those. korbaach's solution may make this point moot, but still worth noting.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Mon Aug 10, 2015 9:12 pm

The solution of korbaach is what I wanted, however, thanks to all for answers!!
B
17
S
3
Posts: 62
Reputation: 1,054


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests