Home Samus MUGEN Fushigi Yuugi Help Links Games
Samus Aran

SAMUS'S TUTORIAL PAGE

PART 7
ADVANCED BACKGROUND DEFINITION - PARALLAX


Overview: Giving your background a 3-D look.
One of the techniques that has been around for quite some time now is motion parallax. It is the option that gives a sprite a feeling of depth by moving one end of the sprite faster than the other end� exactly like the floor effect in Street Fighter II. This is an option, you don�t have to have this for your background� but it can be a really cool effect.

type = parallax
This tells MUGEN that this sprite is going to be given a parallax effect. You must include this for it to work. Then you must include 1 of the next 2.

In MUGEN there are 2 ways of implementing the parallax effect, depending on exactly what you are trying to do.

width = x1, x2
Use this method when you want the sprite to be tiled, so you must include tile = 1. This method is good for a floor or ceiling image that you want repeated over and over� such as a tiled floor, it is also the most easiest to impliment. And these numbers must be an integer ( or cannot have a decimal place. )
x1 is how long you want the top part of the image to be.
x2 is how long you want the bottom part of the image to be.
To give your image a floor appearance, make the x2 variable larger than the x1 variable. However to give the sprite a �ceiling� appearance, make x1 larger than x2.
What you first want to do is to make the larger number the exact size of the sprite, you can get this number simply by opening the image in Microsoft Paint, then click �image� at the top, now choose �attributes� from the drop down menu. Select �pixels� for your units then you will be able to tell what the exact length is. With the smaller variable, you will have to do some tweaking to get it to look right, but generally you would want that number to be around 25% less than the larger variable variable.
xscale = x1, x2
Use this method when you want the sprite not to be tiled. This method is good when you want a single sprite to have the parallax effect, however this method is currently buggy and may not work properly. These numbers must be a float ( or must have a decimal place. )
x1 is how long you want the top part of the image to be.
x2 is how long you want the bottom part of the image to be.
To give the sprite a �floor� appearance, make x2 larger than x1, or to give the sprite a �ceiling� appearance, make x1 larger than x2. Also I good idea is to make the larger number the exact size of the sprite, you can get this number simply by opening the image in Microsoft Paint, then click �image� at the top, now choose �attributes� from the drop down menu. Select �pixels� for your units then you will be able to tell what the exact length is.

yscalestart = percentage
This option is a little hard to explain but it�s not at all complicated. yscalestart scales the height of the image depending on the percentage. 100 is the exact middle and the default percentage. The larger the percentage from 100, the smaller the scale is. The smaller the percentage from 100, the larger the scale is. It�s a very odd way of implementing this feature� but hey who am I to complain.

yscaledelta = percentage
This option allows you to give parallax to the sprite when you jump. The default percentage is 0. I would say a normal percentage would either be 1 or �1 depending on the effect you want to give, I wouldn�t go any farther past that range unless you are doing some expressionist background.

So this is an example of how a parallax would be done:
[BG FLOOR]
type = parallax
spriteno = 1, 0
start = -300, 168
delta = 1, 1
tile = 1, 0 ;this must be included when using width
width = 605, 815 ;815 is the length of the image.
yscalestart = 113
yscaledelta = 0.9

For a better example, open kfm.def. There you will find an example of a parallaxed floor as well as a parallaxed ceiling.




Let's move on.
Hosted by www.Geocities.ws

1