my call constructor at boot game
$gameSystem.huds = new huds(); // build the $gameSystem +
and
the builder function call
/*=============================================================================
* BUILD HUDS INTEGRER (not the menue)
=============================================================================*/
// parrent call from $gameSystem.huds = new HUDS();
function huds() {
this.status = false; // tous les huds visible ou non ? supprime tous image
this.modeCine = false // function qui passe en mode cinema
this.hudstates = new hudstates();
this.hudsSlot = new hudsSlot();
}
//sub from parent
//-----------------------------------------------------------------------------
// le huds des stats -----------------
function hudstates() {
this.status = false; // si visible ou non ?
}
// le huds des itemdice.. hudsSlot -------------------
// $gameSystem.huds.hudsSlot
function hudsSlot() {
this.PIDdebug = [15,47]; // static
this.status = false; // si visible ou non ?
this.XY = [25,0]; // default x y screen // change selon les mode de this.movemode
this.easing = []; // store ici tous les processus de easing
this.SlotXY = [[this.XY[0]+37,this.XY[1]+101],[this.XY[0]+37,this.XY[1]+207],[this.XY[0]+37,this.XY[1]+313],[this.XY[0]+37,this.XY[1]+420],[this.XY[0]+37,this.XY[1]+530],
[this.XY[0]+147,this.XY[1]+101],[this.XY[0]+147,this.XY[1]+207],[this.XY[0]+147,this.XY[1]+313],[this.XY[0]+147,this.XY[1]+420],[this.XY[0]+147,this.XY[1]+530]]; // position des 10 slot item,dice default
this.movemode = function(mode) { if (mode==='default') {this.XY = [25,0]; return this.XY}else if (mode==='tuto') {this.XY = [150,20]; return this.XY}else if (mode==='combat') {this.XY = [25,50]; return this.XY}else if (mode==='hide') {this.XY = [-200,0]; return this.XY} } // defeni this.XY sur le bon mode et return linformation
this.slots = []; // initialise build .slot
for (var s =0; s<10; s++) { this.slots
= new slots() } // les sub slot du jeux, 10 max
}
// $gameSystem.huds.hudsSlot.slots[]
function slots(id) {
this.pintype = null; // un slot est piner ? si oui quel type ?
this.idcontent = 1; // si contient un id item ?
}
_______________________________________________________________________
After if i try stuff ex:
Code:
var x = $gameSystem.huds.hudsSlot.PIDdebug //
console.log(x); // return me [25,0];
// but if i do after
x[0]++;
// the $gameSystem.huds.hudsSlot.PIDdebug[0] are increase
//but $gameSystem.huds.hudsSlot.PIDdebug[0] are supose to be static ?!
//What I would like. Did I get it wrong?