How do I activate random groups?

Get help using Construct 2

Post » Tue Jun 16, 2015 5:44 pm

I need to activate random groups after collision detected... Thanks
B
10
S
1
Posts: 49
Reputation: 600

Post » Tue Jun 16, 2015 6:04 pm

Create a variable for that.
After the collision assign a random value for this variable. Something like
On collision with object > Set var to int(random(10))

After assigning a value for your variable set a condition activating the group you want for different values.
For instance
Variable = 0 > Activate group A
variable = 1 > Activate group B
Variable = 2 > Activate group A and B

Hope this helps ;)
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Tue Jun 16, 2015 6:48 pm

Create a series of groups postfixed with numbers, like:

"Foobar_1"
"Foobar_2"
. . .
..."Foobar_10"

Then go:

Activate Group: "Foobar_" & str( int( random(1,10) ) )
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Thu Jun 18, 2015 6:53 am

Great, i solve it, thanks to all!
B
10
S
1
Posts: 49
Reputation: 600


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests