I have many layouts of game levels. Then I need to pass a instance variables of player, who can take a gun and lose the gun, to another layout. How can I do this?
Thanks in advance.
Think you can do it several ways.
If you give all your weapons an ID, so pistol = 1, Rifle = 2 etc. Or just strings whatever you prefer. And then store that value as a global variable, like "Player_active_weapon", then you could simply check on layout startup, what value is in "Player_active_weapon". And set that weapon to active on the new layout.
A way that would work i think, is if you make an empty event sheet and call it "Player stats" or whatever, then you can add all the player stats like health, weapons, ammunition or whatever you need in there. These values can be used in any layout you have. That way you can simply update that event sheets variables everytime the player interact with the surrounding.
Develop games in your browser. Powerful, performant & highly capable.
It's impossible to pass instance variables?
Cause there are many shooting variables. Gun_1, Gun_2, Gun_3... etc,