Free up processing, use 1 variable :)

This idea was actually obtained while using RPG Maker VX / XP
You can run the entire game off of 1 variable. Go to global code, click "Variables". click add. Make a variable called GAME_VARIABLES, or what ever you like :3
Where it says Array, click Yes, then make it the max size, 32000, for now. You can change the array size once your done making your game.
Now in Global Code, Define your variables like so:
Those are pretty much your non-process eating variables
! Oh, but one more thing. Go back to variables and click GAME_VARIABLES, then click edit. Make it a "real" that way you can also store decimals 
To edit one of your defined variables, or read from them, simply do this:
This will make the HP = 34
To read from a variable using a text actor, for example score
Hope this helped
You can run the entire game off of 1 variable. Go to global code, click "Variables". click add. Make a variable called GAME_VARIABLES, or what ever you like :3
Where it says Array, click Yes, then make it the max size, 32000, for now. You can change the array size once your done making your game.
Now in Global Code, Define your variables like so:
- Code: Select all
#define SHOOT 0
#define ENEMY_SHOOT 1
#define DIFICULTY 2
#define SPAWN_TIME 3
#define HP 4
#define ENEMY_HP 5
#define SCORE 6
Those are pretty much your non-process eating variables


To edit one of your defined variables, or read from them, simply do this:
- Code: Select all
GAME_VARIABLES[HP] = 34;
This will make the HP = 34

To read from a variable using a text actor, for example score
- Code: Select all
sprintf(text, "%g", GAME_VARIABLES[SCORE]);
Hope this helped
