I'm sure this topic has come up before, but Search didn't retrieve it (lots of Global Domination references though -LOL-).
I want to set scores and stats as Global variables so that ALL frames (levels) are consistent. Is that the best way to do it in TGF2? Should each Level be its own Frame, or should I just modify ONE frame after each level, and keep going back to it?
That depends on how you want to organize the rest of your game data.
Personally, I like to use a binary array because the game data stays secure without having to include other encryption extensions. However, a binary array isn't nearly as easy to use as, say; the INI++ object.
If you don't need to save any other game data, global values aren't a bad idea but it's really easy to hack global values with utilities like Cheat Engine. Using other "global array" objects would make that a bit trickier, but not impossible. Question is, how important is game security to you?
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
I'm not worried about Hackers. I'm doing a simple Tower Defense game, kinda like Plants vs. Zombies. The screen looks the same for all levels, but the attackers and defenders will change. So I figure either I have -ONE- frame, and I keep editing its variables depending on 'level', or I have several frames and use Global Variables...
The single frame option seems easiest. My advanced attackers/defenders can stay invisible until needed, and I just call Visibility\Make Object Reappear as needed.
I'm sure the Events editor will be really messy, so I'll have to Comment the heck out of it, and be really good about my Groupings, but in the long run, it still seems easier...
I'm still (always) open to suggestions, comments, criticisms, and yes even flames.
I'm not worried about Hackers. I'm doing a simple Tower Defense game, kinda like Plants vs. Zombies. The screen looks the same for all levels, but the attackers and defenders will change. So I figure either I have -ONE- frame, and I keep editing its variables depending on 'level', or I have several frames and use Global Variables...
The single frame option seems easiest. My advanced attackers/defenders can stay invisible until needed, and I just call Visibility\Make Object Reappear as needed.
I'm sure the Events editor will be really messy, so I'll have to Comment the heck out of it, and be really good about my Groupings, but in the long run, it still seems easier...
I'm still (always) open to suggestions, comments, criticisms, and yes even flames.
Thanks!
Good idea. Just stick with object alterable values / alterable strings / and flags. Save your globals for game settings and current score. You could use INI for a local high-scores table, or just skip local data and upload high scores.
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
Lol, never realized you could hack global variables. I mean, yeah, when you have everything in the same memory area, it's easy to find, but didn't think someone would bother finding it.
If you can do it in a single frame, I'd recommend that you do. A lot easier to code. And yeah, you can toss them into groups. Also consider doing a little scripting, like Lua for some functions you usually use, if you want to keep it more readable.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.