YesNoOk
avatar

Randomize offset of y axis? (Read 438 times)

Started by dsm33606, May 15, 2010, 11:30:17 pm
Share this topic:
Randomize offset of y axis?
#1  May 15, 2010, 11:30:17 pm
  • avatar
  • **
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
Re: Randomize offset of y axis?
#2  May 16, 2010, 12:09:00 am
  • avatar
  • **
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)
Re: Randomize offset of y axis?
#3  May 16, 2010, 12:24:14 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/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.
Re: Randomize offset of y axis?
#4  May 16, 2010, 12:26:28 am
  • avatar
  • **
ahh thanks, I just havent coded in so long lol.. took a break from mugen

2OS

Re: Randomize offset of y axis?
#5  May 16, 2010, 03:54:59 am
  • ****
  • 608 Wannabe
  • Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
    • Egypt
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
Re: Randomize offset of y axis?
#6  May 16, 2010, 04:07:48 am
  • avatar
  • ****
  • Ya me dio cosa...
    • Mexico
Re: Randomize offset of y axis?
#7  May 16, 2010, 10:48:38 am
  • avatar
  • ******
    • Thailand
It's even easier if it's an explod.