Randomize offset of y axis?

Started by dsm33606, May 15, 2010, 11:30:17 PM

Previous topic - Next topic

dsm33606

Wanted to know if theres a way I can randomize the y axis of an offset but between a certain range like lets say... -18 to 18

dsm33606

Nvm figured it out, just in case anyone wanted to know what I did

I used VarRandom:

[State 2002, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -22,22

and just set the axis of the offset I wanted random between -22 and 22 to var(1)

Cyanide

You can do this without a var as well via

-18+random%36


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

dsm33606

ahh thanks, I just havent coded in so long lol.. took a break from mugen

2OS

Quote from: Cyanide on May 16, 2010, 12:24:14 AM
You can do this without a var as well via

-18+random%36

I recommend this method over varrandom for this occasion, for you may not always want the same range value, I personally use this method a lot with different values, especially when coding things like power particles

Dr.Chapatín

Quote from: Cyanide on May 16, 2010, 12:24:14 AM
You can do this without a var as well via

-18+random%37
fixed
random(0-36)

Rajaa Retired

It's even easier if it's an explod.