Home Samus MUGEN Fushigi Yuugi Help Links Games
Samus Aran

SAMUS'S TUTORIAL PAGE

PART 8
ADVANCED BACKGROUND DEFINITION - BACKGROUND CONTROLLERS


Overview: A more advanced library for the creator who's ready to learn more.
OK, so now you want to know some advanced stuff, huh? Stuff that only Yoda can teach, huh? Well then go to the Degoba System you're wasting my time... 'cause I'm here to teach you how to make your background come alive in this chapter. So as Samuel L. would say "Hold hold on to your butts."

The next element type we're going to go over is background controllers. This is a element type that allows you to control the image, and allow it to move however you wish. To implement a background controller use this parameter

id = number

This parameter will assign the controller to this element. Near the bottom of the DEF file, after all of the background elements, is where your background controllers will be. To initiate the background controller write this

[BGCtrlDef number]
looptime = time to loop the controller
CtrlID = number
This will declare the controller's identification with BGCtrlDef and CtrlID, which must be the same number as the parameter id to work. The parameter looptime is optional. Use this only if you the element to repeat itself with a break, the looptime, in game-ticks, declares how long the break will be.

Now the next step will resemble something like the CNS file, for those of you who are familair with it. There is also a cns.doc in MUGEN\DOCS\ so if you need more indepth information you may find it in there, however there are minor differences. What you have to do next is declare background controller elements. This will define the position, velocity, and direction of your image. To do this first you must have

[BGCtrl number]
This will be the header of the controller, this must start every element. number can be any number, most likely you would want it to resemble the id number. So the suggested number would be number.0 then number.1, ect...

Next you must define the element. Each element must be defined with a type and a trigger. A trigger is a parameter that declares when the element will occur. Normally the trigger fo your background controller will look like this

time = number
Where number is the number of game-ticks when the element will begin. Your element willl also need an element type

type = parameter
There are an assortment of element types that can be used here. Here is a list of the types that will be most common

Enable
trigger
value = number
Use this if you need the image not to be drawn immediatly. A value of 0 will disabble the image, and a value of 1 will enable the image.

PosSet
trigger
x = x coordinate
y = y coordinate
This will set the position of the image if you haven't done it already with start =. The x coordinate is relative to the middle of the stage, and the y coordinate is relatve to the zoffset (the floor).

VelSet trigger
x = x coordinate
y = y coordinate
This parameter will set the velocity of the image. The number can be a float (having a decimal point). The number will set how many pixels the image moves per game-tick.

VelAdd
trigger
x = x coordinate
y = y coordinate
This parameter will add to the existing velocity of the image. The number can be a float (having a decimal point). The number will set how many pixels the image moves per game-tick.

VelMul
trigger
x = x coordinate
y = y coordinate
This parameter will mulitply the existing velocity of the image. The number can be a float (having a decimal point). The number will set how many pixels the image moves per game-tick.

SinX
trigger
value = number, time
This parameter will rotate the image on the X axis (left to right), giving the impression that the image is circling around. number is the lenght of the circle. And time, if included, is the time in game-ticks of how long to complete on rotation. (I'm almost positive this is what it's for).

SinY
trigger
value = number, time
This parameter will rotate the image on the Y axis (up and down), giving the impression that the image is circling around. number is the lenght of the circle. And time, if included, is the time in game-ticks of how long to complete on rotation. (I'm almost positive).

So an example of an element should look something like this

[BGCtrlDef 1]
CtrlID = 1

[BGCtrl 1.1]
type = PosSet
time = 1
x = -350
y = 8

[BGCtrl 1.2]
type = Enable
time = 0
value = 1

[BGCtrl 1.3]
type = SinY time = 1
value = -2.5,120


WOW! That's it. This is the end of the tutorial my friend. Thank you for reading, I know it's alot of information. I hope you would be able to use this tool and may it help you on creating an outstanding background of your own. The only other advice I could give you is this:
Use your creativity, it is your best asset when you build something, from a house, to legos, to a background. You're imagination is the limit, trust me, it's not called MUGEN for nothing.

-SamusAran78




Stick a fork in me, I'm done.
Hosted by www.Geocities.ws

1