Rotate + or - x degrees?

Get help using Construct 2

Post » Fri Dec 06, 2013 6:32 pm

I would like to have a sprite randomly rotate either up to +x or -x degrees every so often. random(x) gives me a positive number but I'm looking for a formula that accomplishes returning a number between negative x and positive x but I can't figure it out, math is my weakness.fishbottle2013-12-06 18:33:34
B
24
S
4
G
3
Posts: 43
Reputation: 2,795

Post » Fri Dec 06, 2013 6:40 pm

choose(-(random(x)),random(x))
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 » Fri Dec 06, 2013 6:57 pm

[QUOTE=LittleStain] choose(-(random(x)),random(x))[/QUOTE]

Perfect! That's fantastic.
That will be useful for so many different purposes.

Thanks so muchfishbottle2013-12-06 18:57:13
B
24
S
4
G
3
Posts: 43
Reputation: 2,795


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, FlyingRam and 9 guests