Since engine version: 1.0 OC
The value depends on the movement of the object in Y direction. Each pixel the object moves into positive Y direction increases the value a little bit, and each pixel in negative Y direction decreases it. If end is reached then the value is reset to begin, and if begin is reached then the value is reset to end.
array Anim_Y(int position, int begin, int end, int length);
- Start value. Should be inside the interval given by begin and end.
- Start of the interval.
- End of the interval. If end is greater than begin then the value increases with movement into positive Y direction, otherwise it decreases in that case.
- Number of pixels that need to be moved in Y direction for the animation to be played from begin to end.
See the animation documentation for further explanations of the animation system.
PlayAnimation("Scale", 5, Anim_Y(0, GetAnimationLength("Scale"), 0, 15), Anim_Const(1000));
Plays the animation "Scale" in slot 5, superimposing any other potential animations in slot 5. The animation is being played the faster the faster the object moves into Y direction. After the object moved 15 pixels the animation has been played form start to end and restarts from the beginning. Here we use Anim_Y instead of Anim_AbsY so that the animation is played in the opposite direction if scaling downwards. begin was chosen to be greater than end so that the animation is played forwards for movement in negative Y direction (climbing upwards) and so that it is played backwards for movement in positive Y direction (climbing downwards).