Random Button Generator

Get help using Construct 2

Post » Tue Feb 26, 2013 3:19 pm

Hi guys,
I hope you can help.

I would like to press a button and 1 of 3 images are displayed.
I have set the 3 images to be invisible and on click of the button, they are visible but this is not random and its all 3 not 1.
So, all I have is 1 event 'On clicked'.
I expect its something like 'On clicked' choose between '0', '1', '2' but I cannot find that event?

Any ideas please?
Thanks guys.
Will.
B
9
S
1
Posts: 40
Reputation: 1,120

Post » Tue Feb 26, 2013 3:35 pm

You need that expression
random(0,2)Pakost2013-02-26 15:36:21
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 26, 2013 3:43 pm

I have setup this but no luck:
http://s150.beta.photobucket.com/user/melonrecords/media/Untitled.png.html

Do I need to group them together?
Thanks
Will.
B
9
S
1
Posts: 40
Reputation: 1,120

Post » Tue Feb 26, 2013 4:00 pm

Well it cant work that way
You have 3 different sprites and you pick random instance from the first sprite
Best way in my opinion is to make the button to be only 1 sprite with 3 different frames
Place the 3 instances of that sprite and make them to be the 3 different frames
And then you can do like this:
If Sprite is on frame : random(0,2) then make invisible

Hope it works
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 26, 2013 4:30 pm

Great, works, thanks again.
Will.
B
9
S
1
Posts: 40
Reputation: 1,120


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, emoticon, odiusfly, randomly and 19 guests