How do I do a pick at random?

Get help using Construct 2

Post » Wed Jun 25, 2014 7:14 pm

I need to do a pick at random X amount of times, but I don't see a condition in the object properties. Doing a Peggle style game and I need to find a way to generate 10 random colored orbs.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Jun 25, 2014 8:28 pm

Not sure I get what you need exactly, but you should probably create a loop that runs 10 times and into this loop you pick a random instance and do whatever you want to do with it. :)
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
1
Posts: 530
Reputation: 2,727

Post » Wed Jun 25, 2014 10:39 pm

I don't see the option to create a loop (unless it's paid option only). I'm using the free version. The only thing I see as a loop is "Stop Loop" in the actions.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Jun 25, 2014 10:45 pm

Add an event.
Double click 'System'.
Start typing 'f-o-r' to narrow the choices; you will see For loop is an option.

Are you using Pick Random Instance?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Jun 25, 2014 11:46 pm

Yeah, I'm using Pick Random Instance. I found it. I was looking in the wrong place.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Thu Jun 26, 2014 11:56 am

System > Loops

There are 5 methods for creating loops. In your case I guess the best one is For. Give a name to your loop and use the default settings (1 to 10) which will already give you 10 loop iteractions.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
1
Posts: 530
Reputation: 2,727


Return to How do I....?

Who is online

Users browsing this forum: ST314 and 36 guests