Randomly pick 1/3 box sprites as a trigger

Get help using Construct 2

Post » Sun May 07, 2017 7:03 pm

I have 3 sprites at start of layout - called 'box' - 32x32 in size.
system = create object box on layout 0 at (16,17)
system = create object box on layout 0 at (box+32,17)
system = create object box on layout 0 at (box+32,17)

I'm trying to randomly nominate 1 of 3 boxes to be a trap door. so if 'platform' player collides, the trigger will spring.

I've tried 'Pick a random box instance' with another object, but it just ain't working out.

poor example - sorry
____ ____ ____
| | | | |x |
----- ------- ------

Does this make sense?

I'd appreciate all the help I can get.
Roberto
B
5
S
2
Posts: 63
Reputation: 628

Post » Sun May 07, 2017 7:42 pm

something like this some work.

system = create object box on layout 0 at (16,17), set instance variable = 1
system = create object box on layout 0 at (box+32,17), set instance variable = 2
system = create object box on layout 0 at (box+32,17), set instance variable = 3

on start of layout(or whatever) >>> set global variable to floor(random(1,4))

then system pick by comparison to select the block that has the same instance variable as the random global.
B
25
S
16
G
26
Posts: 125
Reputation: 16,103


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 24 guests