Hi people!
What do you think about a plugin that uses a lot of global variables or use one global variable storing multiple objects?
let shirt = {
color: blue,
size: Big,
etc...
}
I mean, this is a way for us to make plugin parameters, right?
This above, are global objects wrapped in the namespace of the plugin, right?
So if I make some of these Global Objects like:
This can lead me to a performance issue in my plugins? Using a lot of this to store values, booleans etc...
My question about this is that I constantly have to check and use the value from, for example, Game_Timer.prototype... and Sprite_Timer and Window_Timer...
With that, sometimes I have to use:
Window_Timer.prototype.windowWidth();
Inside the codes of Game_Timer or Sprite_Timer...
And I think it is kinda ugly for me.
I have asked it here other times(about performance), and I think I'm thinking a little exaggerated about performance. That's the reason I don't use many global objects and variables(besides those ones that rm mv code already have).
But in the scope of "Making plugins for Rm Mv", should I worried about this?
I mean, a lot of global variables or objects(wrapped in the nameSpace of the plugin) storing values can cause a performance issue in plugins?
What do you think about a plugin that uses a lot of global variables or use one global variable storing multiple objects?
let shirt = {
color: blue,
size: Big,
etc...
}
I mean, this is a way for us to make plugin parameters, right?
JavaScript:
Eli.Param.DevSwitches = {
Playtest: Number(Eli.Parameters['Playtest Switch']),
BattleSc: Number(Eli.Parameters['Battle Switch']), // falta fazer
Mobile: Number(Eli.Parameters['Mobile Switch']),
Desktop: Number(Eli.Parameters['Desktop Switch']),
Vehicle: Number(Eli.Parameters['isInVehicle Switch']),
Airship: Number(Eli.Parameters['isInAirship Switch']),
Boat: Number(Eli.Parameters['isInBoat Switch']),
Ship: Number(Eli.Parameters['isInShip Switch']),
DmgFloor: Number(Eli.Parameters['isOnDmgFloor Switch']),
Dashing: Number(Eli.Parameters['isDashing Switch']),
Bushed: Number(Eli.Parameters['isOnBush Switch']),
Ladder: Number(Eli.Parameters['isOnLadder Switch']),
Timerw: Number(Eli.Parameters['Timer running Switch'])
};
This above, are global objects wrapped in the namespace of the plugin, right?
So if I make some of these Global Objects like:
JavaScript:
Eli.DevSwitches.obj = {
....
}
This can lead me to a performance issue in my plugins? Using a lot of this to store values, booleans etc...
My question about this is that I constantly have to check and use the value from, for example, Game_Timer.prototype... and Sprite_Timer and Window_Timer...
With that, sometimes I have to use:
Window_Timer.prototype.windowWidth();
Inside the codes of Game_Timer or Sprite_Timer...
And I think it is kinda ugly for me.
I have asked it here other times(about performance), and I think I'm thinking a little exaggerated about performance. That's the reason I don't use many global objects and variables(besides those ones that rm mv code already have).
But in the scope of "Making plugins for Rm Mv", should I worried about this?
I mean, a lot of global variables or objects(wrapped in the nameSpace of the plugin) storing values can cause a performance issue in plugins?