Nekoconeko

Changelog

v 1.5 2017 12 25 update with html-bootstrap format, missing format for section 8

v 1.4 2015 09 23 update with netplay, variable framerate

v 1.3 2015 02 19 update with game flow, newer state controllers and functions

v 1.2 2014 12 30 update with additions, updated with index

v 1.1 2014 11 07 update with changes

v 1.0 2014 09 12 creation of the documentation file

1.0 overview

this is the programmer's documentation for the "pantsu of rage" engine.the engine runs at 60gfps, is coded using the monogame framework.the engine makes a lot of use of json to optimize load/development times so if you re not familiar with json make sure to read on it, the document assumes you already know json so json specific explanations will be ommited, you can refer to the following webpages for more information about json

http://json.org/
http://en.wikipedia.org/wiki/JSON
http://www.w3schools.com/json/

the engine refers to the elements as objects, the object hierarchy is the following:

- generic object
- - tangible object
- - projectile
- - character
- - - enemy
- - - player
- background

there are also object containers which follow the following hierarchy:

Game Mode
Arcade Mode
Scene
Stage
Cutscene

the folder structure of the engine is:

content
- animation
- debug
- objects
- script
- sprites
animation
- this folder contains the animation data for all the objects shown in game, refer to the animation sub-section for an explanation of the format, the curent format is json based.
debug
- this folder is used for debug/development output.
objects
- this folder contains the object definitions; characters, background, enemies, etc... are defined there.
script
- this folder contains the script files used for the game objects.
sprites
- this folder contains the sprite sheets used to display the characters, stages and gui. the format for the png files is 32 bit transparent png files.

2.0 animation

the animation file contains an array of animation objects, each animation object has an id and an array of animation frames:

_frames:
it's an array of animation frames
_id:
it's a string that identifies the animation, something like "jump", "stand", etc...; in case two animations have the same id the one loaded latest is the one that gets used

an animation frame contains several parameters that specify how to cut the frame from the sheet, how to draw it and an array of collision boxes:

_spriteId:
this is the filename of the spritesheet file from which to take the sprite, usually a png file
_spriteX:
this is the X value of the starting point of the rectangle to cut the sprite from the sprite sheet
_spriteY:
this is the Y value of the starting point of the rectangle to cut the sprite from the sprite sheet
_spriteWidth:
this is the width of the sprite to cut from the sprite sheet
_spriteHeight:
this is the height of the sprite to cut from the sprite sheet
_layerNo:
this is the layer level on which to draw the sprite, in case of two or more sprites being at the same z level the sprite with the higher layerno is draw on top
_layerType:
this is also used to solve layer conflicts, currently unused
_duration:
how long will the frame will be show before moving to the next frame
_offsetX:
the object is draw at a 0 point in space , it's usually in the middle of the body x wise, bottom of the feet Y wise, the offset is used to specify where to put the object's axis.
_offsetY:
the object is draw at a 0 point in space , it's usually in the middle of the body x wise, bottom of the feet Y wise, the offset is used to specify where to put the object's axis.
_collisionData:
this is an array of collision boxes

a collision box contains it's size, location and how it will handle it's collison logic.

_x:
the x value of the starting position of the collision box, it's based on the object's axis
_y:
the y value of the starting position of the collision box, it's based on the object's axis
_width:
the width of the collision box
_height:
the height of the collision box
_depth:
this is the Z depth of the collision box, it's a value used for both the front and the back so character 1 attack character 2 with a z distance of 10 units need to have a 10+ depth to hit character2
_hit:
boolean flag indicating if the collision box can hit
_hittable:
boolean flag indicating if the collision box can be hit
_grabbable:
specifies if the hit box can be grabbed; there is no grab type attack support at the moment v1.0 of this document is being written but it's planned to get added soon
_default:
default boxes are boxes that keep on being used for the rest of the animation, until a frame that also has at least one default box is found; the algorythm to determine which boxes are used is: load the current frame's collision boxes; from the curretn frame start moving backwards until a default collision box is found (the current frame is also searched for) when a default is box all the frame's default collision boxes are also loaded.

3.0 objects

the objects are loaded based on an id (the id is a string with the name of the object) the engine loads the configuration file that is named the same as the object's id, so if the object is "foo.player", the file foo.player which contains the player's configuration is loaded. the configuration file contains the following sections.

_animation
it's a list of animation files, that way you can share animations between similar objects, like "foo.player" and "foo.enemy", loading order is left to right
_code
it's a list of script files, that way you can share script between similar objects, like "foo.player" and "foo.enemy", loading order is left to right
_palettes
(the terms spritesheet and palette will be used interchangeably in this explanation) this is a list of lists of palette correspondencies; the first level of the list is the palette number/index, it's zero based; the second list uses the index 0 to indicate which the original palette and the index 1 to indicate which palette should be used to replace it.

example:
foo.png is used in the animation file , the line:
"_palettes": [[["foo.png","foo.png"]],[["foo.png","foored.png"]],[["foo.png","foogreen.png"]]]
means that for palette index 0 the animation frames that use foo.ong should reference foo.png, if the palette index is 1 the animation frames that reference foo.png should reference foored.png, same for index 2 and foogreen.That means that we can change the whole sprite look and not just it's colours.

_intConstants
_floatConstants
_stringConstants
those are constant values used by the object's code, the constants depend on the object type; the prefix indicates the dattype of the constants and it's self explanatory.
_doNotDraw
the object becomes a pure object one and is not drawn onscreen
constants
player
_intConstants
maxPower:
the maximum amount of power that the character can charge up
_floatConstants
friction.stand
the friction to apply when the character is standing
friction.air:
the friction to apply when the character is in the air (jump physics Type)
friction.crouch:
the friction to apply when the character is crouching
accelY:
the default y acceleration
jump.velX:
the initial jump velocity
jump.velY:
the initial jump velocity
jump.velZ:
the initial jump velocity
_stringConstants name: the character's name; unused as v1.0 of this documentation was written.
* several of those constants are still not used as v1.0 of this document has been written and are there for illustration/intended purposes

4.0 script

the code runs on a state machine, you can load multiple script files per object, each script file contains a list of states. there are three types of states : current, before and after, current states are states whose code is executed only when the character is in that specific state, the before type states are all executed before the current state, the after states are executed after the current state.
A state is made of two sections, the state's variables and the state controllers, the state variables are used when the object changes to that state normally to set object internal variables.
Normally current type states are used to depict a character's movelist, while the previous type states are used to change from one state to other by putting all state logic in a single place, after type states are used to perform aditional checks.

4.1 state

  example of a state:
	
	"_id": "stand",
	"_type": "current",
	"_moveType": "idle",
	"_physicsType": "stand",
	"_animation": "stand",
	"_controlLevel": 1,
	"_velX": 0,
	"_velY": 0,
	"_velZ": 0,
	"_landAutomatically": false,
	"_faceEnemy": true,
	"_stateControllers":
			[
				{
					"_type": "changeState",
					_parameters :
					[
						{"_name": "state", "_value": "'walk'","_valueType": "string"},
						{"_name": "or", "_value": "_commandEquals('holdForward') || _commandEquals('holdDown') || _commandEquals('holdUp') ", "_valueType": "boolean" }
					]
				}
			]
	
_id:
the id of a state, used to uniquely identify a state, if more than one state has teh same id only the state that was loaded last is used,
_type:
[ current, after, before] indicate how to execute the state
_moveType:
[ attack, idle, guard, hit, projectile] those values indicate what type of move the state is, attack and projectile are required to hit the oponent, idle means that the object is not attacking, guard makes it so the character goes into a guarding state if sucesfully attacked, hit menas that the object is being hit and projectile is used for states that are used in a projectile's coding.
_physicsType:
[stand,crouch,air,fly,liedown] this indicates the type of physics to be applied by the engine's hardcode, stand , liedown and crouch get friction applied and no gravity, air gets gravity applied and no friction fly does not get gravity or friction applied it's most common use is for projectiles.
_animation:
the id of the animation to be played when the object gets in this state
_controlLevel:
the level of control to be used when in this state; the control variable is to be used to decide when the object can perform certain movements/go to certain states.
_velX:
the X component of the velocity to use when in this state.
_velY:
the Y component of the velocity to use when in this state.
_velZ:
the Z component of the velocity to use when in this state.
_powerAdd:
the amount of power to add when entering this state, the power can be used later as a condition when changing to other states.
_landAutomatically:
for air type states, if this flag is set to true or null the character goes to the standar landing state, if it's set to false, the character does not use the standar landing code
_faceEnemy:
make the character turn if the enemy is behind, useful for gethit states

4.2 state controller

there are several different types of state controllers, those are used to script the logic of the object, they normally consist of a type and a list of parameters, the type specifies what does teh satte controller actually does and the parameter can be divided in two types, condition parameters (and, or) and value parameters, the condition parameters tell the engine when to execute the state controller while the value parameters are values used by the state controller.

state controllers have a parent child hierarchy, used to inherit certain parameters and make the code more manteainable.

_id:
the id of the state controller, used by the parent parameter.
_type:
the type of state controller
_parent:
specifies the parent state controller
_parameters:
the list of parameters teh state controller uses.

state parameter
the state parameter has the following fields

_name:
the name of the parameter, it's used to indicate what type of parameter it is, it's use depends on the type of state controller
_value:
the actual value of the parameter, this is the value used by the state controller, as of v 1.0 of this document depending on the state controller the values can be expressions.
_inherit:
specifies whether or not this paremeter will be inherited to this state controller's childs
_valueType:
[int,float,boolean,string,intList,floatList,booleanList,stringList] indicates the type of value of the parameter, it can be an single value or a comma separated array

* certain parameters of certain state controllers do not support yet expressions in the value of their parameters.

an important type of parameters are the and and or parameters; both are of boolean type. they are used to know when is a state controller executed, all the and type parameters must evaluate to true for the state controller to be executed. the or type parameters only need one of them to be evaluated as true for the state controller to be executed. if there are no and type parameters in the sctrl the and condition is evaluated to true, if there are no or type controllers the state parameter is evaluated to false.

5.0 state controllers

This is a list of state controllers, their effect on the game engine and the parameters they utilize.

executeConditionStart

executeConditionEnd

these two must be used as a pair; all the state controllers after an executeConditionStart state controller and before an executeConditionEnd state controller are considered a block; if the executeConditionStart is evaluated to false the block is not executed, if executeConditionStart evaluates to true the block is executed, the executecondition pairs can be nested.

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.

endState

it is always executed, does not support expressions

it ends the current state sending the character to the stand or crouch state depending on the physics type.

parameters:

onAnimationEnd:
[string] if it's value is true it perform the state change when the current animation is over.

changeState

supports expressions, it's executed when it evaluates to true

changes the current state of the object.

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.
state:
[string] id of the state to change to

changePhysicsType

supports expressions, it's executed when it evaluates to true

changes the type of physics of the object, it also performs friction and acceleration setting depending on the physics type.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
type:
[string] the type of physics to change to [stand,crouch,air,liedown,fly]

changePosition

supports expressions, it's executed when it evaluates to true

changes the position of the object.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
x,y,z:
[float] the value of the position component, if a component is not specified , that component is not changed.

changeVelocity

supports expressions, it's executed when it evaluates to true

changes the velocity of the object.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
x,y,z:
[float] the value of the velocity component, if a component is not specified , that component is not changed.

setVariable

supports expressions, it's executed when it evaluates to true

sets the value of a variable; this state controller is a special case as there are no fixed parameter names and and and or, the parameter name indicates the name to give the variable to be set, you can use this to set more than one variable per state controller.as of version 1.0 of this document only single variables are supported, no list types.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
[any parameter name]:
the parameter name is the name of the variable to set, the valueType of the parameter is used to determine the value type of the variable

turn

supports expressions, it's executed when it evaluates to true

changes the facing of the object; only the X coordinate is affected by the facing, the controls and graphics facing can be changed separately.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
graphics:
[boolean] if true, it changes the facing used for drawing
controls:
[boolean] if true, it changes the facing of the controls, forward becomes back and back becomes forward.

changeSide

supports expressions, it's executed when it evaluates to true

changes the side the object, normally you need to be on a different side to another object for you to be able to hit it.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
side:
[int] number of the side to change to

destroyProjectile

supports expressions, it's executed when it evaluates to true

destroys a projectile with the specified id, 'self' is a special value which destroys the current object assuming it's a projectile.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] id of the projectile to destroy, as of version 1.0 of this documentation only 'self' is supported

projectile

supports expressions, it's executed when it evaluates to true

creates a projectile, a projectile can use the engine's hardcode bynot specifying state parametersbut it's recommended to create it's own states to have better control over it's behaviour. there is a hardcoded behaviour for reflected projectiles but a customized one can be created as well.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
type:
[string] type of projectile as of version 1.0 of this document it is unused
animation:
[string] the animation id to use for the projectile's initial state
state:
[string] the state id to use for the first state of the projectile, a projectile can use multiple states for more complex cases or a single state. the state code has the projectile's hitDefinitions
stateHit
[string] the state id to change to when the projectile hits something
stateGetHit
[string] the state id to change to when the projectile gets hit by something
stateOffBound
[string] the state id to change to when the projectile moves offbound, moving below the position Y of 0 is considered offbound
stateReversed
[string] the state id to change to when the projectile is reflected
velX,velY,velZ
[float] the velocity to give to the projectile when it's created
accelX,accelY,accelZ
[float] the acceleration to give to the projectile when it's created
offsetX,offsetY,offsetZ
[int] the offset in which to create the projectile, a value of 0,0,0 means that the projectile's axis position will be teh same as the projectile owner's
friction
[float] friction value to apply to the projectile

hitDefinition

it is always executed, does not support expressions

it creates a hit definition and adds it to the hitDefinitions list, the hit definition is used by the collision boxes with a hit parameter of true to attack players of the opposing side.

parameters:

activeFrames:
[intList] the number of the frames for which the hit definition is active
affectMoveType:
[stringList] the moveTypes that can be afected by this hitDefinition, an empty list means all values.
affectPhysicsType:
[stringList] the physicsTypes that can be afected by this hitDefinition, an empty list means all values.
pause:
[int] the amount of ticks to pause the two objects that collide by using this hitDefinition's rules
duration
[int] the amount of ticks the target affected will stay on the hit state
damage
[int] the amount of damage to apply to the target
guard
[stringList] [stand,crouch,air] list parallel to physicsType, if the affected object is on a guard moveType, instead of being sent to the hit state it will be sent to a guard state
velX,velY,velZ
[float] the velocity to give to the target
accelX,accelY,accelZ
[float] the acceleration to give to the target
friction
[float] the friction to give to the target
hitAnimation
[string] [normal,fall] it's the animation for the target to play, the value of normal makes the character play the animation depending on it's current physics, the value of fall makes the character get into a fall state.
reflectProjectiles
[boolean] if true, this hitdefs will force the projectiles to get reflected. there is a hardcoded behaviour for reflected projectiles but a customized one can be created.
isGrab
[boolean] signal to whetehr the attack is a grab
targetState
[string] put the target in the indicated state ( the states must be in the target's code )

the next sub-section is the hitspark subsection

hitspark.animation
[animation] the animation to show for the hitspark
hitspark.offsetX
[int] the offset in which to create the hitspark, a value of 0,0,0 means that the hitsparks's axis position will be teh same as the hitsparks owner's
hitspark.offsetY
[int] the offset in which to create the hitspark, a value of 0,0,0 means that the hitsparks's axis position will be teh same as the hitsparks owner's
hitspark.offsetZ
[int] the offset in which to create the hitspark, a value of 0,0,0 means that the hitsparks's axis position will be teh same as the hitsparks owner's
hitspark.type
[string]
hitspark.dissapear:
[string] condition on which to make the hitspark dissapear, "onAnimationEnd" means to make it dissapear once the animation is over
hitspark.velX
[float] the velocity to give to the hitspark
hitspark.velY
[float] the velocity to give to the hitspark
hitspark.velZ
[float] the velocity to give to the hitspark
hitspark.accelX
[float] the acceleration to give to the hitspark
hitspark.accelY
[float] the acceleration to give to the hitspark
hitspark.accelZ
[float] the acceleration to give to the hitspark
friction
[float] friction value to apply to the hitspark

endIntro

supports expressions, it's executed when it evaluates to true

signals the engine/scene to end the intro state of the character

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.

endWin

supports expressions, it's executed when it evaluates to true

signals the engine/scene to end the win state of the character

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.

endLose

supports expressions, it's executed when it evaluates to true

signals the engine/scene to end the lose state of the character

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.

changeAnimation

supports expressions, it's executed when it evaluates to true

changes the animation to the specified animation

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
and, or:
[boolean] used to determine if the state controller evaluates to false or true.

createEffect

supports expressions, it's executed when it evaluates to true

creates an effect onscreen

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.
animation:
[string] the name of the animation to play
dissapear:
[string] condition on which to make the effect dissapear, "onAnimationEnd" means to make it dissapear once the animation is over
source:
[string] the object to use as a source for the effect, the effect's animation is pulled from that object's files, the efect's position is also based on that object, "character" means the character running the script will be used as the source, "stage" menas it will be the actual background, any non "character" values are treated as stage.
velX,velY,velZ
[float] the velocity to give to the effect
accelX,accelY,accelZ
[float] the acceleration to give to the effect
offsetX,offsetY,offsetZ
[int] the offset in which to create the effect, a value of 0,0,0 means that the effect's axis position will be the same as the effect owner's
friction
[float] friction value to apply to the effect
facing
[int] the facing with which to crate the effect, 1 is facing right -1 is facing left, defaults to 1
id
[string] a name to identify the effect with, used by the changeEffect sctrl

addtoPosition

supports expressions, it's executed when it evaluates to true

adds a value to the current position, takes facing into account as well as stage limits.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
x,y,z:
[float] the value of the position component, if a component is not specified , that component is not changed.

changeFrame

supports expressions, it's executed when it evaluates to true

changes the frame that is currently being shown without chaning the animation

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
frame:
[int] the number of the frame to change to

changePower

supports expressions, it's executed when it evaluates to true

changes the power of the character, can be used to add to the power

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
power:
[int] the value to set the power to

changeLife

supports expressions, it's executed when it evaluates to true

changes the life of the character, can be used to add to the life

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
life:
[int] the value to set the life to

changeScene

supports expressions, it's executed when it evaluates to true

changes the scene of the current game mode

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.
scene:
[int] the *.scn configuration file of the scene we want to change to

useSelectedMenuItem

supports expressions, it's executed when it evaluates to true

for menu type scenes, it fires the event of the menu items that is currently selected.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
player:
[string] the player index of the selected menu item to use , useful for menues that accept input for more than one player

selectCharacter

supports expressions, it's executed when it evaluates to true

it selects a character for a specific player, can be used in the script of complicated selection screens/menus

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
character:
[string] the *.player configuration file of the character we want to select
playerNo:
[int] the index of the player we want to select the character for, 0 = player1, etc...

changeGameMode

supports expressions, it's executed when it evaluates to true

It changes the current game mode to a different one

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
gameMode:
[string] the *.cfg configuration file of the gamemode we want to change to

createEffect

supports expressions, it's executed when it evaluates to true

changes the parameter of an effect, the id is mandatory so the parameters of the efect with that id are changed

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.
id
[string] the name of the effect whose parameters we will change
animation:
[string] the name of the animation to play
dissapear:
[string] condition on which to make the effect dissapear, "onAnimationEnd" means to make it dissapear once the animation is over
source:
[string] the object to use as a source for the effect, the effect's animation is pulled from that object's files, the efect's position is also based on that object, "character" means the character running the script will be used as the source, "stage" means it will be the actual background, any non "character" values are treated as stage.
velX,velY,velZ
[float] the velocity to give to the effect
accelX,accelY,accelZ
[float] the acceleration to give to the effect
offsetX,offsetY,offsetZ
[int] the offset in which to create the effect, a value of 0,0,0 means that the effect's axis position will be the same as the effect owner's
friction
[float] friction value to apply to the effect
facing
[int] the facing with which to crate the effect, 1 is facing right -1 is facing left, defaults to 1

destroyEffect

supports expressions, it's executed when it evaluates to true

destroys an effect so it stops being drawn, the id is mandatory

parameters:

and, or :
[boolean] used to determine if the state controller evaluates to false or true.
id
[string] the name of the effect to destroy

changeToRootScene

supports expressions, it's executed when it evaluates to true

It changes the current game mode's scene to the first one in the list,

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
flags:
[string] supply an aditional behaviour when changed to the base scene
values
resetCharacterSelection
resets the list of selected characters, useful when the first scene is a character selection scene, so the characters can get selected again

createText

supports expressions, it's executed when it evaluates to true

creates a simple text message

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
text:
[string] the text to show
font:
[string] the font to use for the text we are going to show
layerNo:
[int] the layer in which to type the text
layerType:
[string] the type of the layer in which to type the text
posX:
[int] the position x for the text's upper left corner
posY:
[int] the position y for the text's upper left corner
color:
[string] the color to use for the text, the format is "R,G,B,A"

createDialog

supports expressions, it's executed when it evaluates to true

creates a dialog box, the dialog box has a set width and height so word and linewrap can be used for it,

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
text:
[string] the text to show
font:
[string] the font to use for the text we are going to show
layerNo:
[int] the layer in which to type the text
layerType:
[string] the type of the layer in which to type the text
posX:
[int] the position x for the text's upper left corner
posY:
[int] the position y for the text's upper left corner
color:
[string] the color to use for the text, the format is "R,G,B,A"
width
[int] the width for the dialog
height
[int] the height for the dialog
stopSequence
[boolean] if set to true and if the state is sequential, it stops the satte code execution until the dialog's text has been completely shown
keysToAdvance
[stringList] a "," separated list of the keys that while pressed make the dialog advance lines
timetoAdvance
[int] the amount of ticks to wait until teh dialog advances one line, if a key to advance is pressed the waiting time is reset, a value of 0 means that the dialog won't advance automatically

createMenu

supports expressions, it's executed when it evaluates to true

creates a popup menu, the way to do it is calling a .scn menu type scene on it's parameters

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
source:
[string] the *.scn scene file of the menu to show as a popup menu
posX:
[int] the position x for the popup menu's upper left corner
posY:
[int] the position y for the popup menu's upper left corner
stopSequence
[boolean] if set to true and if the state is sequential, it stops the state code execution until the popup menu is closed
[named parameters]
[string]

named parameters are a special case, similar to the setVariable state controller, named parameters are pased to the pop up menu so it can receive the data from the script. example:

{"_name": "source", "_value": "'yesnomenu.scn'", "_inherit": null, "_valueType": "string"}, {"_name": "question", "_value": "'do you want to stop on this cutscene?'", "_valueType": "string"},

this code is part of a create menu sctrl, in the yesnomenu.scn scene we have the following menuItem

{"_id":"question", "_type": "text", "_label": "_defaultText('question')", "_posX":0, "_posY":0, "_event":"null", "_eventData":"null", "_restrictInput":10000, "_selectedColor":"255,0,0,255", "_unselectedColor":"255,255,255,255"}

in the default label the use the _defaultText function of scenes, that one searches for the question parameter and shows it's value; that way we can recycle the yesnomenu.scn in multiple instances (as a side note, a value of 10 on _restrictInput , means that only player11 can select this menu, thus making the text effectively work as a label as it becomes unselectable )

changeMoveDescriptor

supports expressions, it's executed when it evaluates to true

changes the descriptor of the current move, it's used for the ai to learn which move is being used as an optimization against using the animation adn animation frame

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
type:
[string] the type of move

playSound

supports expressions, it's executed when it evaluates to true

Plays a sound , the sounds can be buffered by the scene

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
soundName:
[string] name of the sound file to play, without extension
type:
[string] file type of teh sound file to paly, supportted types are mp3, midi, ogg and xnb
id:
[string] an identifier for the sound, used to modify it later
volume:
[float] the volume of the sound, must be a flaot value between 0 and 1.0
looped:
[boolean] used to indicate if the sound wil play only once (false) or if it will loop (true)
pitch
[float] used to change the pitch of the sound, values go from -1 to 1

changeSound

supports expressions, it's executed when it evaluates to true

changes the parameters of a sound, uses the id to modify it

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] the identifier of the sound to get modified
volume:
[float] the volume of the sound, must be a float value between 0 and 1.0
looped:
[boolean] used to indicate if the sound wil play only once (false) or if it will loop (true)
pitch
[float] used to change the pitch of the sound, values go from -1 to 1

stopSound

supports expressions, it's executed when it evaluates to true

Stops a sound from playing

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] the identifier of the sound to get stopped

freezeInputBuffer

supports expressions, it's executed when it evaluates to true

normally inputs (button presses, sequences) are buffered for a specific amount of game ticks, this state controller makes it so the buffer does not decrease while this sctrl is active, as an example it's used in jump start so the comands are buffered and executed once you have left the ground.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.

createLayer

supports expressions, it's executed when it evaluates to true

creates a layer based on the object's layer buffer/config, the layer is overimposed on the character

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] the identifier of the layer to get created

destroyLayer

supports expressions, it's executed when it evaluates to true

destroys a layer with the existing id

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] the identifier of the layer to get destroyed

setGameVariable

supports expressions, it's executed when it evaluates to true

Sets the value of a game variable; this state controller is a special case as there are no fixed parameter names sand and and or, the parameter name indicates the name to give the variable to be set, you can use this to set more than one variable per state cdontroller.as of version 1.0 of this document only single variables are supported, no list types.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
[any parameter name]:
the parameter name is the name of the variable to set, the valueType of the parameter is used to determine the value type of the variable

saveGameVariables

supports expressions, it's executed when it evaluates to true

saves all the game variables to a file, the variables to save and the file they get saved to are configured in the scene's code.

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.

setMenuItemProperty

supports expressions, it's executed when it evaluates to true

changes the value of a property of a menu item

parameters:

and, or:
[boolean] used to determine if the state controller evaluates to false or true.
id:
[string] the id of the menuitem to affect
visible:
[boolean] shows/hides the visibility of a menu item
enabled:
[boolean] enables/disables a menu item

6.0 expressions

the expressions are used in the engine to determine the value of certain parameters, based on internal varibales from the engine/object.examples of expressions are:
_commandEquals('2qcfX') && controlLevel == 1 && physicsType != 'air' && power >= 1000
posY > 0 && velY > 0

the expressions consist of operators, static values, variables and functions, the parenthesis are a special operator that is used to adjust precedence, the variables can be custom variable screated with the setVariable state controller or internal variables of the object. a logical value of true equal an int value of 1 , a logical value of false equals an in value of 0, in reverse only 0 is read as logical false while any value different to 0 is treated as true by the logical operators. the value type returned by an operator depends on the value type of the operands and the operator itself.

6.1 operators:

The operators are ordered by precedence from lowest to highest, most operators are the same as they are in standar programming languages.

= += -= *= /= :
assignment operators a custom variable should beon the left side of the assignment
&& ||
logical and and or operators
<= >= != == < >
comparison operators
+ -
addition and substraction operators
* / %
multiplication, division and module operator
-
unary minus operator, changes the sign of a value
! -- ++
unary operators, logical negation
^ & |
bit wise xor, and and or operators
~
exponentiation operator , 2~2 == 4
->
redirection operator, in the left side goes the object id, in the right side goes the functino/variable to get the value for. what this does is get the value of the variable/funciont on it's right, using as context the value on it's left, so _player(1)->_commandEquals('Z1') means it gets the value of the z command for player(1) regardless of where this code is being used

6.2 variables

variables start with any letter or a . character and the rest of the variable's name can be any letter , any number or the . and _ characters, certain variable names are reserved as internal variables:

6.2.1 list of internal variables

controlLevel:
[int] returns the level of control of the object, 0 means no control and 1 means full control.
physicsType:
[string] returns the physicsType of the object
stateTime:
[int] returns the amount of game ticks the object has been on the current state
velX:
[float] returns the current x velocity of the object
velY:
[float] returns the current y velocity of the object
velZ:
[float] returns the current z velocity of the object
posX:
[float] returns the current x position of the object
posY:
[float] returns the current y position of the object
posZ:
[float] returns the current z position of the object
side:
[int] returns the side of the object, normally only objects of different sides can hti each other.
currentAnimation:
[string] return the id of the current animation
currentFrame:
[int] returns the number of the current frame
currentState:
[string] returns the id of the current state
life
[int] return the remaining life of the player
attackHitTime
[int] returns the amonut of time that has elapsed since the current attack hit another object, a value of 0 means it has not hit anything
frameTime
[int] returns the amount of time the current frame has been shown on screen
facing
[int] returns the facing of the character (control wise), 1 = facing right, -1 = facing left
matchIsOver
[int] returns true if the match is already over
sideWon
[int] returns the numerical valeu of the side that won the match ( not the round )
firstTickOfFrame
[boolean] returns true if we are on teh first tick of the current render frame; when the logical frames per second are different to the render frames per second a rendered frame can be on screen for more than one logical tick
roundState
[string] returns the current value of the roundstate , the values can be: intro, fighting, fightingOver, win
isAlive
[boolean] return true if the character still has not been knocked out for the round, false if the character was already knocket out
previousState
[string] saves the id of the previous state
sceneId
[string] returns the id of the current scene
firstTickOfFrame
[boolean] returns true if we are currently in the first tick of a render frame; a game can be rendered on a smaller fps than the code is being executed, this variable returns true if we are in the first logical tick of a rendered frame, false if the frame has already been drawn and we are on teh second or further logical

6.3 functions

functions start with the _ character, then comes the function name, then the parameters between parentheses, functions return a single value to be used in expressions

6.3.1 list of functions

commandEquals ("command.name")
[boolean] checks if the command "command.name" is currently active, when the player inputs a command the command is saved in a buffer; commands are normally used to cahgne from one state to the next. return 1 if the command isa active 0 if not.
list of commands
A,B,C,X,Y,Z,S
: those commands check for a key/button being pressed, they only return true if the button was not being pressed in one tick, then it's pressed the tick right after.
up,down,forward,back
: those commands check for a direction pressed, they only return true if the directionwas not being pressed in one tick, then it's pressed the tick right after.
hold[A,B,C,X,Y,Z,S]
: those commands check if a key/button is being held, it wil return true regardless of how long the button has been held.
hold[up,down,forward,back]
: those commands check if a direction is being held, it wil return true regardless of how long the direction has been held.
qcf[A,B,C,X,Y,Z,S]
: quarter circle ended by the indicated keypress
dp[A,B,C,X,Y,Z,S]
: "dragon punch" (F,D,DF) ended by the indicated keypress
dd[A,B,C,X,Y,Z,S]
: down,down command ended by the indicated keypress
2qcf[A,B,C,X,Y,Z,S]
: double quarter circle ended by the indicated keypress
currentFrame(0)
[int] the parameter is irrelevant, returns the frame number of the current frame being show, the first frame of the animation is frame 0
frameTime(0)
[int] the parameter is irrelevant, returns for how many ticks the current frame has been shown, the parameter is disregarded as of v1.0 of this document
getAnimationTimeLeft(0)
[int] the parameter is irrelevant, returns how many ticks are left before we reach the end of teh animation, once we reach teh end of teh animation it returns 0, the parameter is disregarded as of v1.0 of this document
_animationExists("animation.id")
[boolean] it checks for existance of the animation with the indicated id, returns 1 if the animation exists, 0 if not
_p2distance("x-y-z")
[float] receives the component to check for the distance, returns the actual distance between the character and the closest character of the oposite side that is closer in that distance
_turnbuckleConstant(string)
[string] receives a string that is the name of a turnbuckle constant, the it returns the value of said constant, as an example it can get used to get the turnbuckle's height. the turnbuckle whose data we get is the one closest to the object callilng the code x-z wise
_turnbucklePosition("x-y-z")
[float] receives a string that is the component to check, the it returns the actual distance on that component. the turnbuckle whose data we get is the one closest to the object callilng the code x-z wise
_turnbuckleDirection(0)
[string] the parameter is irrelevant, returns the direction relative to the character of the turnbuckle first string character is "ns" for north or south and second character "we" for west and east. the turnbuckle whose data we get is the one closest to the object callilng the code x-z wise
_turnbuckleDistance("x-y-z")
[float] receives the component to check for the distance, returns the actual distance between the character and the closest turnbuckle that is closer in that distance
_abs(number)
[float] receives a numerical value and returns it's absolute value
_selectedMenuItemId(0)
[int] receives the player id and returns the id of the selected menu item, used in the script menu scenes. the playerid is normally 0 but it can also be 1 for menues that have more than one player.
_cameraPosition("x-y-z")
[string] receives a position component (x,y,z), it returns the position of the camera.
_gameVariable("playerID")
[string] returns a specific game variable depending on it's parameter, parameter playerID returns the id of player1
_getEffectParameter ("id", "parameter")
[string] returns the value of an effect's parameter; it receives the id of the parameter and the name of the effect.
_getMenuAnswer(0)
[string] returns the value of the menu answer buffer, whena menu is created and it closes after giving an answer , it fills this buffer
_ifElse(boolean, "parameter1", "parameter2")
[string] if the boolean evaluates to true it returns "parameter1", if it's false it returns "parameter2"
_getGameVariable("variableName")
[multiple] returns the value of a game variable, the type of teh value depends on the game variable's type
_player("player number")
[id] returns the object id of the player N, used in conjunction with the ->(redirection) operator
_connectionStatus(0)
[string] returns the status of the network connection; valid statuses are: waitingForClient, selectingServer, searchingServer, awaitingServerReply, acceptingClient, requestDenied, loadingFight, fighting, disconnected

7.0 debugging

to debug you need a debug build , the debug keys are:

f12
pauses the engine
f11
advances one frame
f9
open debugging console

the debug console is there so you can edit the animation timings or the state controller parameters:
first it asks you to edit whether to edit animation or code
second it asks you the id of the animatino/state to edit
if you are editing an animation you ahve to choose the frame to edit, then you edit the timing of said frame
if you are editing the state code you have to choose the state controller and then the parameter, once you do that you type v to edit the parameter's value
once you are done editing, typing "s" in the prompt saves the anim_ or code_ file with the adjustments

8.0 configuring game flow

8.1 game elements

  GameMode
	
	this is a general cointainer for the game flow, there are different game types. Game mode configurations are saved in the modes subfolder inside the content folder
	a game mode has variables, named game mode variables

	_id				[string ] 		this is the id for the game mode, used to identify it
	_mode			[string]		this is the game mode type, the possible values are:
									arcade				
									versus
									aivsai
									training
									any other value		a generic game mode is loaded, it behaves mostly as a menu
									most of the differences between game modes are in how sides are handled while selecting the characters
									
	_sceneList		[string list]	this is the list of scenes that the game mode will load, it starts at the first scene then goes to the next scene when a sceneOver event is fired
	_controlsNo		[int]			this is the number of human controls that the game mode will read, it's used mostly to tell apart 1p and 2p modes, also to restrict the menues to a certain amount of players
	_playersNo		[int]			the amount of players to create, usually 1 for arcade/hisotry game modes 0 for ai vs ai modes and 2 for versus or cooperative modes
	_aisNo			[int]			the amount of ais to select/carry as partners or to use in training mode
	_saveFile		[string]		the file in which to save the gamemode variables, common examples of game variables are the key input and the screen resolution
	_loadFile		[string]		the file from which to read the game mode variables

	
	Game Variable
	
	_name						[string]	the name of the variable
	_value						[string]	the value fo the variable, it is the default value when a file is read and the varaible does not exist in it
	_type						[string]	the variable type: int, float, string, boolean

	Scene
	
	this is a scene, multiple scenes make a gamemode , most of the scenes will be stages or menus, their configuration fiels are saved in the scenes folder:
	
	_id								[string]	this is the id for the scene, used to identify it
	_type							[string]	this is the scene type, the possible values are:
										stage		this is an interactive/fighting scene
										menu		the scene is a configurable menu, it creates menu items based on the _menuItems data
										cutscene	this is a cutscene
	_background						[string]	this is the configuration file for teh background object, located in the objects subfolder
	
	_orientation					[string] 	this is the orientation of the menu, it's possible values are:
										vertical		the menu items are selected up to down
										horizontal		the menu items are selected left to right
										rectangular		the menu items are a square, pressing left or right right changes items 1 by 1, pressing up or down changes the row, so the selected menu item changes depending 
														on the 	amount of columns,
								
	_disableAfterSelectingCharacter	[boolean]	if set to true disables the menu control once a character has been selected, mostly used for versus mode so a player can only select one character
	
	_rows							[int]		used for rectangular type menus, it's used to indicate how many rows of menuItems will the menu have
	_columns						[int]		used for rectangular type menus, it's used to indicate how many columns of menuItems will the menu have
	_scriptObject					[string]	if set to null/not set, it is ignored; otherwise it's value is the configuration file in the objects folder of a script object for this scene: this is a way to make scenes 
												that interact with the player, an example is a cutscene that shows text based on the player's input.
	
	
	_roundLimit						[int]		a number indicating the aomunt of round to play for stages, once one side has won over half of the rounds the scene is now over.
	_numberOfSides					[int]		the amount of sides this scene will handle, side 0 is reserved for scene object, side 1 and side 2 are adversarial sides.
	
	_effectsFile					[string]	used ostly for stages; it's value is the configuration file in the objects folder of a script object for this scene, this object containts the animation data for lifebars,
												turnbuckles and hit sparks that will be used in this scene, it also containts their configuration data.
	
	_fonts							[stringList] list of xnb font files in the fonts folder, this is the list of fonts the scene will use, it's mostly useful for menues and cutscenes, the first font is the default one.
	
	_autoJumpToNextScene			[boolean]	if true, once this scene is over (usually because one side has won in a stage) the gamemode will jump to the next scene, 
												it can also be set to false so the scene's script object is the one telling the game mode to which scene to jump to next.

	_saveVariables					[game variable list]
												this is a list of the game variables that will be loaded/saved on this scene, in the case of menu type scenes those variables can be assigned to menu items
												
	_saveFile		[string]		the file in which to save the scene's variables
	_loadFile		[string]		the file from which to read the scene variables

	
	_menuItems						[menu item list]
												this is a list of menu items, used in menu type scenes, it containts the general menu item configuration such as it's type, position, event that it fires 
												and data that depends on it's type
	
	Menu Item
		_id							[string]	this is the id for the menu item, used to identify it; it can eb refered to by the script
		_posX						[int]		the starting position for the menu item X component
		_posY						[int]		the starting position for the menu item Y component
		_event						[string]	the event this menu item will fire, most menu item fire the event when A is pressed and they are selected
												the event types are:
													changeScene			changes to the scene specified in the event data, event data has the configuration filename.
													changeGameMode		changes to the gamemode specified in the event data, event data has the configuration filename.
													saveData			saves the _saveVariables in the _saveFile
													exitGame			exist the game completely
													selectCharacter		selects a character, event data has the configuration filename for the character to select
													continueAnswer		answer to a continue menu, event data indicates whetehr tog o to the previous scene or to a different scene
													menuAnswer			answer to a menu, it's normally used when the menu is used as a pop up menu, the evenData is put in the menu answer buffer
													
		_eventData					[string]	the data to use when firing the event, it is event dependant
		
		_type						[string]	this is the type of the menu item, the behaviour depends heavily on the type, the types are:
												text
												list
												number
												key
												scriptable	any no existing type defaults to scriptable
		
		_variable					[string]	name of the variable that will be bind to this menu item, it's used on configuration menus so this menu items gets and modified said game variable's value
		_restrictInput				[int]		if this parameter is set to a value > -1 only the control N (0 is the first control or p1 .1 is the second cotrnol or p2, etc.. ) only that control can
												select this menu item, by setting it to a control value taht does not exist, like 9999, the menu item is unselectable. the other use is so only p1 or p2 can access certain configuration options ( like the key/input configuration )
		_minimumValue				[int]		used for number type menu items, is the lower range for this item; if you want to select values form 0 to 9 this value would be 0
		_maximumValue				[int]		used for number type menu items, is the upper range for this item; if you want to select values form 0 to 9 this value would be 9
		_steps						[int]		used for number type menu items, is the amount of values that will be shown
		
		_values						[stringList]	used for list type menu items, it's a list of the list's elements values
		_labels						[stringList]	used for list type menu items, it's a list of the list's elements labels, this is the text that will be drawn on screen
	
		_label						[string]	it's the label/text that will be shown for this menu item
		_selectedColor				[string]	this is the colour of the text that will be shown when this menu item is selected, the colour format is "R,G,B,A"
		_unselectedColor			[string]	this is the colour of the text that will be shown when this menu item is not selected, the colour format is "R,G,B,A"
		_chooseKeyColor				[string]	this is the colour of the text that will be shown when this menu item has it's key being selected, this refers to key type menu items, the colour format is "R,G,B,A"
		
		_state						[string]	it's the unselected state of this menu item, it's used for scriptable menu items
		_configId					[string]	it's the script object that contains the script code of this menu item, it's used for scriptable menu items
		_visible					[boolean]	if true, teh emnu item is visible, if false , it's invisible
	
  

8.2 game configuration example

	this refers to configuring a game in general,
	to configure a full game the first step is to configure a "menu" type game mode to load it first, in it's scene list you configure scenes for the intro then a menu type scene to show all the game play modes so the user can select them, running the game via a .bat file we can tell it which is the first game mode to load:
	as an example, turnbuckler.cfg is like this:
	
	"_id": "turnbuckler",
	"_mode": "menu",
	"_sceneList": ["mainmenu.scn"],
	"_controlsNo": 1,
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",
	
	the mode is menu because we don't need any real gamemode rules to be complied with, we enable control for one user, the scene we load is named mainmenu.scn, which contains the game modes we configured for this game as well as a configuration menu.
	
	now, on to configurating the first menu
	
	"_id": "mainmenu",
	"_type": "menu",
	"_background": "titlebg.bg",
	"_orientation": "vertical",
	"_menuItems":[	{"_id":"arcade", "_state": "arcade.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":200, "_event":"changeGameMode", "_eventData":"arcade.cfg"},
					{"_id":"versus", "_state": "versus.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":220, "_event":"changeGameMode", "_eventData":"versus.cfg"},
					{"_id":"aivsai", "_state": "aivsai.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":240, "_event":"changeGameMode", "_eventData":"aivsai.cfg"},
					{"_id":"training", "_state": "training.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":260, "_event":"changeGameMode", "_eventData":"training.cfg"},
					{"_id":"options", "_state": "options.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":280, "_event":"changeGameMode", "_eventData":"options.cfg"},
					{"_id":"exit", "_state": "exit.unselected", "_configId": "mainmenu.menu","_posX":200, "_posY":300, "_event":"exitGame", "_eventData":"exit.cfg"}]
	
	we make a scene of type menu, so that creates the menu objects we configure to it. then we point to the background object we will use for it. next comes the menu orientation which in our case is vertical, then we have alist of menu objects, each one with a changeGameMode event, which points to the game mode configuration file that corresponds to the game mode we want to change into, the last menu item exits the game.
	in this case all the menu items use  images/animations/scripts from the "mainmenu.menu"  script file. in the menu item's selected states we point to the menu it's selected animations and do similarly for the unselcted states.
	
	then we change game modes, for arcade.cfg we have the following configuration:
	
	"_id": "arcade",
	"_mode": "arcade",
	"_comment": "only up to colloseum is really used, the rest of the stages are choosen by stage script",
	"_sceneList": ["select.scn", "intro_arc.scn","colloseum_arc.scn", "cave_arc.scn", "mansion_arc.scn", "iceland_arc.scn", "carpet_arc.scn"],
	"_controlsNo": 1,
	"_playersNo": 1,
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",

	the mode is arcade, so it ahs the apropiate behaviour, we enable control for one, then enable one player for the mode, the files used for saving/loading are the ones that have the general game configuration data.
	for each different mdoe we make a set of scenes, since the scenes are very similar (liek teh carpet set of scenes ) the only notable change is their script file.
	
	now, on to select.scn
	
	"_id": "mainmenu",
	"_type": "menu",
	"_background": "selectbg.bg",
	"_orientation": "rectangular",
	
	"_fonts":["smallFont","comic"],
	
	"_rows": 2,
	"_columns": 4,
	"_scriptObject":"select.menu",
	"_menuItems":[	
					{"_id":"bannou", "_state": "bannou.unselected", "_configId": "select.menu","_posX":250, "_posY":120, "_event":"selectCharacter", "_eventData":"bannou.player"},
					{"_id":"bannou_b", "_state": "bannou_b.unselected", "_configId": "select.menu","_posX":284, "_posY":120, "_event":"selectCharacter", "_eventData":"bannou_b.player"},
					{"_id":"bannou_g", "_state": "bannou_g.unselected", "_configId": "select.menu","_posX":318, "_posY":120, "_event":"selectCharacter", "_eventData":"bannou_g.player"},
					{"_id":"bannou_r", "_state": "bannou_r.unselected", "_configId": "select.menu","_posX":352, "_posY":120, "_event":"selectCharacter", "_eventData":"bannou_r.player"},
					
					{"_id":"bannou", "_state": "bannou.unselected", "_configId": "select.menu","_posX":250, "_posY":158, "_event":"selectCharacter", "_eventData":"bannou.player"},
					{"_id":"bannou_b", "_state": "bannou_b.unselected", "_configId": "select.menu","_posX":284, "_posY":158, "_event":"selectCharacter", "_eventData":"bannou_b.player"},
					{"_id":"bannou_g", "_state": "bannou_g.unselected", "_configId": "select.menu","_posX":318, "_posY":158, "_event":"selectCharacter", "_eventData":"bannou_g.player"},
					{"_id":"bannou_r", "_state": "bannou_r.unselected", "_configId": "select.menu","_posX":352, "_posY":158, "_event":"selectCharacter", "_eventData":"bannou_r.player"}
					
					]
	
	the scene is of type menu, the orientation is rectangular we use code from select.menu, in this case to show a portrait related to the selected menu item as well as to have a secret character. the menu items are scriptable type to show a different border around the small portraits of the character's menu, the menu items have a select character event along the config file of the apropiate character matching to the protrait.
	regarding the script we navigate ot the scene's script object which is select.menu, then to select.script which containts the code.

	once a character is selected, the game changes to the next scene which is intro_arc.scn

	"_id": "intro_arc",
	"_type": "cutscene",
	"_background": "intro.bg",
	"_roundLimit" : 1,
	"_numberOfSides" :3,
	"_effectsFile": "lifebar.bar",
	
	"_fonts":["smallFont","comic"],
	
	"_scriptObject":"intro_arc.menu",
	"_autoJumpToNextScene": false,

	"_players":
	[
		{
			"_characterType" : "player",
			
			"_side" : 1,
			"_facing" : 1,

			"_posX" : 200,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,

		}
	],
	
	first we define this as a cutscene next we use our specific intro.bg object, then we specify the fonts and our script object.
	
	"_objectId": "intro",
	"_animation": ["intro.anim"],
	"_code": ["intro.script"],
	"_palettes": [
		[["intro.png","intro.png"]]
	],
	"_intConstants": {
		"_leftBoundary": 80,
		"_rightBoundary": 40,
		"_topBoundary": 40,
		"_bottomBoundary": 40,
		"_width": 1280,
		"_height": 0,
		"_depth": 60,
		"_startPositionX": 0,
		"_startPositionY": 0,
		"_startPositionZ": 0,
		
		"_cameraWidth": 1280,
		"_cameraHeight": 720,
	},
	"_shape" : [
		{"X": 100, "Y":480},
		{"X": 680, "Y":480},
		{"X": 800, "Y":530},
		{"X": 680, "Y":580},
		{"X": 100, "Y":580}
	]
	
	in the background object, the most important part is that we modify the cameraWidth and Height so we get a higher resolution for the cutscene, everything else is normal background configuration.
	
	in the intro_arc.menu, we call intro_arc.script as well as configure the animation/sprite files we will use for the speaking portaits / tachie:
	now in the script file the init state _sequential atribute is true so it executes the state controllers one by one and does not reset to state controller 0 between ticks.
	first we create a base body layer for the tachie, then we put a neutral face to it, after that we create a small dialog to give the player some information, we set stopSequence to true so no more state controllers are executed until the dialgo is over, next we create a menu using the yesnomenu.scn scene configuration file we also set stop sequence to true so the code waits for the menu answer.
	now depending on the menu answer we either change the overlay on top of the tachie to change it's facial expression or enable a block fo code using the executeConditionStart sctrl, in teh code block we create a new dialog then we create a pop menu using the  start_arc.scn configuration file. at last we chagne the scene based on the menu answer.
	
	now we move to the next scene, sicne the route depends on several factors we will use iceland_arc as an example:
	
	"_id": "iceland_arc",
	"_type": "stage",
	"_background": "iceland.bg",
	"_roundLimit" : 1,
	"_numberOfSides" :3,
	"_effectsFile": "lifebar.bar",

	"_scriptObject":"iceland_arc.menu",
	"_autoJumpToNextScene": false,

	"_players":
	[
		{
			"_characterType" : "player",
			
			"_side" : 1,
			"_facing" : 1,

			"_posX" : 200,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,

		},
		{
			"_characterType" : "ai",
			
			"_configId" : "bannou.player",
			"_palette" : 0,
			
			"_side" : 2,
			"_facing" : -1,

			"_posX" : 400,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,
			
		}
	],
	
	this will be of type stage, so the fighting engine is used, then we point to our effects file and our script object, we disable outjump so the script can select the next stage instead,
	in the list of players configuration for the scene we enable one player type character so we get it from the game mode and one ai type character, we also specify the ai character's configuration file so ti loads a specific character , we specify both characters sides as well as their initial positions on the scene.
	
	iceland_arc.menu points to iceland_arc.script, in this file we have the following code:
	
				{
					"_type": "changeScene",
					_parameters :
					[
						{"_name": "or", "_value": "matchIsOver == true && sideWon == 1", "_inherit": null, "_valueType": "boolean"},
						{"_name": "scene", "_value": "'carpet_arc.scn'", "_inherit": null, "_valueType": "string"}
					]
				},
				{
					"_type": "changeScene",
					_parameters :
					[
						{"_name": "or", "_value": "matchIsOver == true && sideWon == 2", "_inherit": null, "_valueType": "boolean"},
						{"_name": "scene", "_value": "'continue_arc.scn'", "_inherit": null, "_valueType": "string"}
					]
				}
				
	so, depending on which side won the match, we change to either the continue screen ( side 2 won) or the next scene (in this case carpet_arc)
	in the case of carpet_arc
				{
					"_type": "changeGameMode",
					_parameters :
					[
						{"_name": "or", "_value": "matchIsOver == true && sideWon == 1", "_inherit": null, "_valueType": "boolean"},
						{"_name": "gameMode", "_value": "'turnbuckler.cfg'", "_inherit": null, "_valueType": "string"}
					]
				}
	in the case side 1 wins , we change back to teh title screen to finish the game, we could also change to a cutscene to show the character ending.
	
	now, the continue scene is:
	
		"_id": "continue_arc",
	"_type": "menu",
	"_background": "continue_arc.bg",
	"_orientation": "vertical",
	"_effectsFile": "continue_arc.bg",

	"_scriptObject":"continue_arc.menu",
	"_menuItems":[	
					{"_id":"yes", "_state": "yes.unselected", "_configId": "continue_arc.menu","_posX":250, "_posY":200, "_event":"continueAnswer", "_eventData":"previous"},
					{"_id":"no", "_state": "no.unselected", "_configId": "continue_arc.menu","_posX":250, "_posY":220, "_event":"continueAnswer", "_eventData":"select.scn"}
				 ]
				 
	it is a menu type scene, we configure our script object and a menu with scriptable menu items for the yes no options. the yes option has an event of type continueAnswer, which jumps to the previous scene, which in this case would be the scene in which we just lost. the no option goes back to the select.scn scene so we can select characters again.
	
	continue_arc.menu points to continue_arc.script, in this file we create an animation for the countdown, another for the "continue ?" question, then, once 10 seconds / 600 ticks have passed we change to another state in which we use the "useSelectedItem" sctrl, so even if A has not been pressed in the menu items we forcefully fire the selected items's event.
	
	now, onto vs mode:
	
	"_id": "versus",
	"_mode": "versus",
	"_sceneList": ["select_versus.scn", "stageSelect_versus.scn"],
	"_controlsNo": 2,
	"_playersNo": 2,
	"_aisNo": 0,
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",

	the mode is versus , in our scene list we put our character select scene then a satge select scene, we enable two controls, one per player, 2 players and no ais .
	
	select_versus.scn is pretty much the same as the arcade one, the important difference is that we point to a different script object, select_versus.menu, in there we go to select_versus.script, in there we also adjust the camera and change the scene's script object animation based on the selected menu item as we did in select_arcade, but we also create and change an effect based on the second selected menu item using the _selectedMenuItemId(1) function.
	
	
	stageSelect_versus.scn is a simple menu taht shows one scriptable object per stage 
	
	"_id": "stageSelect_versus",
	"_type": "menu",
	"_background": "stageSelect_versus.bg",
	"_orientation": "rectangular",
	
	"_rows": 2,
	"_columns": 3,
	"_menuItems":[	{"_id":"carpet", "_state": "carpet.unselected", "_configId": "stageSelect_versus.menu","_posX":100, "_posY":100, "_event":"changeScene", "_eventData":"carpet_versus.scn"},
					{"_id":"cave", "_state": "cave.unselected", "_configId": "stageSelect_versus.menu","_posX":260, "_posY":100, "_event":"changeScene", "_eventData":"cave_versus.scn"},
					{"_id":"colloseum", "_state": "colloseum.unselected", "_configId": "stageSelect_versus.menu","_posX":420, "_posY":100, "_event":"changeScene", "_eventData":"colloseum_versus.scn"},
					{"_id":"mansion", "_state": "mansion.unselected", "_configId": "stageSelect_versus.menu","_posX":180, "_posY":220, "_event":"changeScene", "_eventData":"mansion_versus.scn"},
					{"_id":"iceland", "_state": "iceland.unselected", "_configId": "stageSelect_versus.menu","_posX":340, "_posY":220, "_event":"changeScene", "_eventData":"iceland_versus.scn"},
				]
	
	in the event data we put the scene we want to play vs mode at all the selectable scenes have a simialr configuration:
		
	the mansion_versus.scn is the following

	"_id": "mansion_versus",
	"_type": "stage",
	"_background": "mansion.bg",
	"_roundLimit" : 1,
	"_numberOfSides" :3,
	"_effectsFile": "lifebar.bar",
	
	"_scriptObject":"mansion_versus.menu",
	"_autoJumpToNextScene": false,

	"_players":
	[
		{
			"_characterType" : "player",
			
			"_side" : 1,
			"_facing" : 1,

			"_posX" : 200,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,

		},
		{
			"_characterType" : "player",
		
			"_side" : 2,
			"_facing" : -1,

			"_posX" : 400,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,
			
		}
	],

	we disable autojump to next scene, and specify mansion_versus.menu for oru script object, in the character list both characters are of _characterType "player" so tehya re laoded from the game mode's selected players.
	
	then onto the mansion_versus.script we ahev the following code
	
	"_type": "changeToRootScene",
	_parameters :
	[
		{"_name": "or", "_value": "matchIsOver == true ", "_inherit": null, "_valueType": "boolean"},
		{"_name": "flags", "_value": "'resetCharacterSelection'", "_inherit": null, "_valueType": "string"}
	]
	
	this changes to the first scene of the game mode once the match is over, in this case the "select_versus.scn" scene.
	
	next is the aivsai mode
	
		"_id": "aivsai",
		"_mode": "aivsai",
		"_sceneList": ["select_aivsai.scn", "stageSelect_aivsai.scn"],
		"_controlsNo": 1,
		"_playersNo": 0,
		"_aisNo": 2,
		
		"_saveFile" : "config.txt",
		"_loadFile" : "config.txt",
	
	in the configuration mode we set the type to aivsai, like the versus mode we configure a select scene and a stage selection scene. teh mode is configured with 1 control so one  player can select teh ais that will fight, 0 player as tehre won't be player controlled characters and 2 ais.
	
	the select_aivsai scene is the same as the versus one, the only difference is the script file, select_aivsai.script , here the script is the same as the one in the arcade mode one as we only select characters one by one.
	stageSelect_aivsai scene folow the exact same logic as the versus one, except that it points to the _aivsai stages instead of the versus one.
	
	then for a fighting scene/stage
	
	"_id": "mansion_aivsai",
	"_type": "stage",
	"_background": "mansion.bg",
	"_roundLimit" : 1,
	"_numberOfSides" :3,
	"_effectsFile": "lifebar.bar",
	
	"_scriptObject":"mansion_aivsai.menu",
	"_autoJumpToNextScene": false,

	"_players":
	[
		{
			"_characterType" : "ai",

			"_side" : 1,
			"_facing" : 1,

			"_posX" : 200,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,
		},
		{
			"_characterType" : "ai",
		
			"_side" : 2,
			"_facing" : -1,

			"_posX" : 400,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,
			
		}
	],
	
	both characters are of ai type, the rest of the file is the same as the regular stage configuration. in the script file we just reset to the select screen as we did in versus.
	
	next is the training mode
	
	"_id": "training",
	"_mode": "training",
	"_sceneList": ["select_training.scn", "stageSelect_training.scn"],
	"_controlsNo": 1,
	"_playersNo": 1,
	"_aisNo": 1,
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",
	
	the medo is training, we enable one control, one player type character and one ai type character.
	
	the select_training scene is the same as the versus one, the only difference is the script file, select_training.script here the script is the same as the one in the arcade mode one as we only select characters one by one.
	stageSelect_training scene folow the exact same logic as the versus one, except that it points to the _training stages instead of the versus one.
	
	then for a fighting scene/stage
	
	"_id": "mansion_training",
	"_type": "stage",
	"_background": "mansion.bg",
	"_roundLimit" : 1,
	"_numberOfSides" :3,
	"_effectsFile": "lifebar.bar",
	
	"_scriptObject":"mansion_training.menu",
	"_autoJumpToNextScene": false,

	"_players":
	[
		{
			"_characterType" : "player",
			
			"_side" : 1,
			"_facing" : 1,

			"_posX" : 200,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,

		},
		{
			"_characterType" : "ai",
		
			"_side" : 2,
			"_facing" : -1,

			"_posX" : 400,
			"_posY" : 0,
			"_posZ" : 500,
			
			"_life" : 1000,
			"_power" : 3000,
			
		}
	],
	
	we have one player character and one ai type character, in the case of the ai type we don't specify the character file to load so teh engine will load the ai we just selected previously, the rest of the file is the same as the regular stage configuration. in the script file we just reset to the select screen as we did in versus.
	
	next is the options mode
	
	"_id": "options",
	"_mode": "menu",
	"_sceneList": ["options.scn"],
	"_controlsNo": 2,
	"_playersNo": 0,
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",
	
	the mode for it will be menu as we don't need any specific gameplay behaviour, we enable control for 2 players (so palyer 2 can configure his own keys ) , 0 player type characters as thre won't be real gameplay thre anyway.
	we only have one scene, the main options.scn one.
	
	"_id": "options",
	"_type": "menu",
	"_background": "titlebg.bg",
	"_orientation": "vertical",
	"_fonts":["smallFont","comic"],
	
	the scene is of type menu, it is a vertical one and we declare the fotns we will use, that is important as we will create text type menu items and they require the font.
	
	"_saveFile" : "config.txt",
	"_loadFile" : "config.txt",
	
	"_shareSelectedItem" : true,
	
	we configure the save and the load files as the config file we use for the rest of the game modes, so all of the have access to the same data. we set share selected item to true.
	
	"_saveVariables": [ {"_name": "difficulty", "_value": "5", "_type": "int" },
						{"_name": "sfxVolume", "_value": "50", "_type": "int" },
						{"_name": "soundVolume", "_value": "40", "_type": "int" },
						{"_name": "resolution", "_value": "1280,720", "_type": "string" }
					],	
	
	those are the variables that will be saved to the file, we also give them default values.
	
	"_menuItems":[	{"_id":"difficulty", "_type": "list", "_label": "difficulty", "_variable": "difficulty", "_posX":200, "_posY":200, "_event":"null", "_eventData":"null",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255",
						"_labels":["easy","normal","hard"],
						"_values":["0","5","9"]
					},
					{"_id":"inputConfig", "_type": "text", "_label": "input", "_posX":200, "_posY":220, "_event":"changeScene", "_eventData":"inputConfig.scn",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255"},
					{"_id":"sfxVolume", "_type": "number", "_label": "sfx volume", "_variable": "sfxVolume", "_posX":200, "_posY":240, "_event":"null", "_eventData":"null",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255",
						"_minimumValue":"0", "_maximumValue":"100","_steps":"10"
					},
					{"_id":"soundVolume", "_type": "number", "_label": "sound volume", "_variable": "soundVolume", "_posX":200, "_posY":260, "_event":"null", "_eventData":"null",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255",
						"_minimumValue":"0", "_maximumValue":"100","_steps":"10"
					
					},
					{"_id":"resolution", "_type": "list", "_label": "resolution", "_variable": "resolution", "_posX":200, "_posY":280, "_event":"null", "_eventData":"null",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255",
						"_labels":["640 x 360","1280 x 720","1920 x 1080"],
						"_values":["640,360","1280,720","1920,1080"]					
					},
					{"_id":"save", "_type": "text", "_label": "save", "_posX":200, "_posY":300, "_event":"saveData", "_eventData": "config.save",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255"},
					{"_id":"exit", "_type": "text", "_label": "exit", "_posX":200, "_posY":320, "_event":"changeGameMode", "_eventData":"turnbuckler.cfg",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,0,255,255"},
				]
	
	as for the menu items:
	the first is the difficulty , we use a list type item for it, we name and label it as "difficulty" and asociate the difficulty variable to it, set the apropiate colors for being selected and unselected, it won't fire an event so we null it.then we ocnfigure the label we will have for the difficulty, in this case just 3 levels and we ocnfigure their apropiate numericla values as difficulty can only range from 0 to 9.
	the second one is the input configuration, it's of type text, instead of configuring something itself what it does is call the inputConfig.scn Scene by using a change scene event.
	the sfx volume is of type number, we associate it to the sfxVolume variableset the minimum and maximum values and the amount of steps it will show.
	now the resolution is associated to the resolution variable, it's a list type menuItem, in teh list we have the resolutions we will allow to be used and their apropiate labels.
	for the save menu item we have a text type menu item, for the event we fire a save data, so the variables are saved to the config.txt file.
	for exit we have a text type menu item, in it's event we change the game mode to turnbuckler.cfg so we effectively go back to the initial game mode.
	
	finally comes the inputConfig.scn file
	
	"_id": "inputConfig",
	"_type": "menu",
	"_background": "titlebg.bg",
	"_orientation": "vertical",
	"_fonts":["smallFont","comic"],
	"_saveFile" : "inputConfig.txt",
	"_loadFile" : "inputConfig.txt",
	
	it's a vertical menu, with properly configured fonts, we save the variables to the inputConfig.txt file because the inputs can read the configuration from there.
	
	"_saveVariables": [ {"_name": "player1A", "_value": "65", "_type": "int" },
						{"_name": "player1B", "_value": "83", "_type": "int" },
						{"_name": "player1C", "_value": "68", "_type": "int" },
						{"_name": "player1X", "_value": "81", "_type": "int" },
						{"_name": "player1Y", "_value": "87", "_type": "int" },
						{"_name": "player1Z", "_value": "69", "_type": "int" },
						{"_name": "player1S", "_value": "82", "_type": "int" },
						{"_name": "player1up", "_value": "38", "_type": "int" },
						{"_name": "player1down", "_value": "40", "_type": "int" },
						{"_name": "player1left", "_value": "37", "_type": "int" },
						{"_name": "player1right", "_value": "39", "_type": "int" },
						
						{"_name": "player2A", "_value": "46", "_type": "int" },
						{"_name": "player2B", "_value": "35", "_type": "int" },
						{"_name": "player2C", "_value": "34", "_type": "int" },
						{"_name": "player2X", "_value": "45", "_type": "int" },
						{"_name": "player2Y", "_value": "36", "_type": "int" },
						{"_name": "player2Z", "_value": "33", "_type": "int" },
						{"_name": "player2S", "_value": "189", "_type": "int" },
						{"_name": "player2up", "_value": "104", "_type": "int" },
						{"_name": "player2down", "_value": "101", "_type": "int" },
						{"_name": "player2left", "_value": "100", "_type": "int" },
						{"_name": "player2right", "_value": "102", "_type": "int" },
						
					],	
	
	for the variables we configure the variables that will contain the player's input configuration, since we want two player support we have one set for player1 and one set for player2, for the varaibles name we use the player id for the input (player1, player2, etc...) then we concatenate the button name,it can be a single letter or a full word.
	
	"_menuItems":[	
					{"_id":"p1A", "_type": "key", "_label": "A", "_variable": "player1A", "_posX":200, "_posY":100, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1B", "_type": "key", "_label": "B", "_variable": "player1B", "_posX":200, "_posY":110, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1C", "_type": "key", "_label": "C", "_variable": "player1C", "_posX":200, "_posY":120, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1X", "_type": "key", "_label": "X", "_variable": "player1X", "_posX":200, "_posY":130, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1Y", "_type": "key", "_label": "Y", "_variable": "player1Y", "_posX":200, "_posY":140, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1Z", "_type": "key", "_label": "Z", "_variable": "player1Z", "_posX":200, "_posY":150, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1S", "_type": "key", "_label": "S", "_variable": "player1S", "_posX":200, "_posY":160, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1up", "_type": "key", "_label": "up", "_variable": "player1up", "_posX":200, "_posY":170, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1down", "_type": "key", "_label": "down", "_variable": "player1down", "_posX":200, "_posY":180, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1left", "_type": "key", "_label": "left", "_variable": "player1left", "_posX":200, "_posY":190, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p1right", "_type": "key", "_label": "right", "_variable": "player1right", "_posX":200, "_posY":200, "_restrictInput":0,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					
					{"_id":"p2A", "_type": "key", "_label": "A", "_variable": "player2A", "_posX":300, "_posY":100, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2B", "_type": "key", "_label": "B", "_variable": "player2B", "_posX":300, "_posY":110, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2C", "_type": "key", "_label": "C", "_variable": "player2C", "_posX":300, "_posY":120, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2X", "_type": "key", "_label": "X", "_variable": "player2X", "_posX":300, "_posY":130, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2Y", "_type": "key", "_label": "Y", "_variable": "player2Y", "_posX":300, "_posY":140, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2Z", "_type": "key", "_label": "Z", "_variable": "player2Z", "_posX":300, "_posY":150, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2S", "_type": "key", "_label": "S", "_variable": "player2S", "_posX":300, "_posY":160, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2up", "_type": "key", "_label": "up", "_variable": "player2up", "_posX":300, "_posY":170, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2down", "_type": "key", "_label": "down", "_variable": "player2down", "_posX":300, "_posY":180, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2left", "_type": "key", "_label": "left", "_variable": "player2left", "_posX":300, "_posY":190, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
					{"_id":"p2right", "_type": "key", "_label": "right", "_variable": "player2right", "_posX":300, "_posY":200, "_restrictInput":1,
						"_selectedColor":"255,0,0,255", "_unselectedColor":"0,0,0,255", "_chooseKeyColor":"255,255,0,255"
					},
			
					{"_id":"save", "_type": "text", "_label": "save", "_posX":200, "_posY":300, "_event":"saveData", "_eventData": "config.save",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,255,255,255"},
					{"_id":"exit", "_type": "text", "_label": "exit", "_posX":200, "_posY":320, "_event":"changeScene", "_eventData":"options.scn",
						"_selectedColor":"255,0,0,255", "_unselectedColor":"255,255,255,255"},
				]
	
	in the menu item list we have three main sets, the first and second sets are the  input configuration for the players, the items are of key type, the label corresponds to the ingame key so the player can easily know which key he is configuring, then we bind the key to the apropiate variable; since we want only p1 to be able to configure player1 input we configure the restrict input index to 0 for player1's inputs, same for player2 using index 1, then we set the selected and unselected colours as apropiate, we also configure the _chooseKeyColour, this colour is used when the player presses A on top of a key type menu item, once the player does that the key changes colour to the choose key one and the next key that is pressed will be the value that will be assigned to the variable.
	
	the third set are the exit and save menu items, save is just  a text item and which we have a savedata event; exit is a test type menu item, for it's event we change the scene to the options.scn which is the previous menu file.