What parameter should I use??

Get help using Construct 2

Post » Thu Dec 06, 2012 11:04 pm


I have a ball(bullet) of 300 speed and an angle of motion to random of 360 degrees. This the entered parameter: random(360).

What parameter should I use to make it randomly in 0 and 180 degrees?

Thanks in advance.
Posts: 20
Reputation: 390

Post » Thu Dec 06, 2012 11:11 pm

Do you mean any value between 0 and 180:
random(0, 181) or random(181)

Or do you want to pick either 0 or 180:
choose(0, 180)

[quote=Manual]random(a, b)
Generate a random float between a and b, including a but not including b.

choose(a, b [, c...])
Choose one of the given parameters at random. E.g. choose(1, 3, 9, 20) randomly picks one of the four numbers and returns that. This also works with strings, e.g. choose("Hello", "Hi") returns either Hello or Hi. Any number of parameters can be used as long as there are at least two.
I'd also advise you to check out System Expressions in the manual.Nimtrix2012-12-06 23:14:46
Posts: 903
Reputation: 8,452

Post » Thu Dec 06, 2012 11:22 pm

Thanks man!
It worked well!

Keep it up.
Posts: 20
Reputation: 390

Return to How do I....?

Who is online

Users browsing this forum: henryScirra, sudeep98 and 24 guests