I will talk about how to make Sine movement on chars and stages, to make more smooth animations.
I will explain more about Sine below.
STAGES:take a look at
http://www.elecbyte.com/mugendocs/bgs.html for more info about stages
[BG mirror]
type = normal
spriteno = 6,0
start = 0, -142
delta = 0.7,0.9
layerno = 0
mask = 1
sin.y = -8, 240Let me explain the trigger:
sin.y = -8, 240- Sin is senoide curve
http://en.wikipedia.org/wiki/Sine_wave- sin.y means that we are going to have the effect just on the y axis (vertical). For horizontal movement, use sin.x (*)
- -8 is how much the element will move (keep in mind that we are talking about a Senoide, so it will move the amount*2 = 16 (-8 and 8).
- 240 is the total time of a whole curve (the up and the down anim).
Some images to illustrate the effect:
(*) on Mugen 1.0 this parameter is basically superseded by the
SinX background controller.
Look at
http://www.elecbyte.com/mugendocs/bgs.html#background-controllersCHARS:On chars, its a bit more complex.
From SodonHID's codes:
[State xxx, x]
type = VelSet
trigger1 = 1
X = 3*sin(time/4.0) ; ** Originally, it was (time/4)
Y = 3*cos(time/4.0); ** Originally, it was (time/4)
4 is the frequency (the "speed").
3 is the range (or amplitude, diameter)
** Using
Bia words:
It may seem ridiculous, but time/4 will never bring a fractional result (5 / 4 = 1 for mugen). While time/4.0 results in a fractional number.
To summarize:
value / integer = integer division (without fraction). The result is an integer
value / actual value (eg 1.0) = split real (fraction). The result is a real number.By ChonWang:Just to help:
x = sin (time * A) * B
y = cos (time * A) * B
. The lower | A | and | B |, spins more slowly
. The lower | A | or higher | B |, the larger the radius
Notes:
- Signal (A × B) indicates the direction: counterclockwise (+), clockwise (-)
- The addition of VelAdd creates a helix
- | x | x is the module, ie the absolute value of x.
hope that is helps.