Choose vs Random

Discussion and feedback on Construct 2

Post » Tue Dec 11, 2012 2:42 pm

In setting up a Dice sprite, is there any preferred method when it comes to choosing between:
Choose    or    Random?

In reading the manual, I can see where both would work just fine.

Thank you.
B
4
Posts: 4
Reputation: 508

Post » Tue Dec 11, 2012 2:50 pm

The difference is how you're going to set the expression itself.

For a 6 side dice you would use :

Choose(1,2,3,4,5,6)
or
int(random(1,7))

Choose returns only one of the parameters inputed, whereas random would return any number in the range, so adding int() and making sure the range is between 1 and 7 (random won't never return/reach the last bound of the range).

Also choose() can accept strings as parameters whereas random() only deals with numbers (float).Kyatric2012-12-11 14:51:14
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Tue Dec 11, 2012 2:51 pm

Whatever you like, it doesn't make much difference really.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests