How to make random number?

Get help using Construct 2

Post » Thu Jan 23, 2014 2:24 pm

So basically you collide with a stack of cash, I want it to then add my variable of cash a random number instead of a fixed one to represent different cash amounts.

        [On Player Collision > StackOfCash]
                  [Add to cash]
                     [???]

That's what I am looking at right now, I don't know how to make the variable generate a random number between 2 numbers.
B
1
Posts: 6
Reputation: 137

Post » Thu Jan 23, 2014 2:25 pm

random(10,21)

but you probably want only round numbers

floor(random(10,21))LittleStain2014-01-23 14:26:06
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 23, 2014 2:26 pm

also you could use:

choose(10,15,20)

to choose one of those three amounts.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 23, 2014 2:38 pm

DIdnt know about this choose-thing, really good tip :)
Image
Check out our start-up and configure your own helmet in true 3D.
B
44
S
11
G
11
Posts: 1,154
Reputation: 9,978

Post » Thu Jan 23, 2014 3:30 pm

Learning system expressions can really help you come up with all kinds of new ideas for doing things :).

https://www.scirra.com/manual/126/system-expressions
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667


Return to How do I....?

Who is online

Users browsing this forum: JackTYGA, PROxMTswatTR and 21 guests