In general, programs have variables. If you’ve ever done algebra you might have an idea of what variables are, except in programming variables be several types. A string is any arbitrary word or phrase, an int (or real or double – depending on programming language) is a number you can do math on, or check things like greater or less than, and there’s a boolean which is either True or False (1 or 0, Yes or No).
The example I always give is Zelda, how you name your character is a String, how many rupees you have is an int, whether you have beaten the first level is a boolean.
And then this data is all saved. Except it isn’t just saved to a text file (usually) because they don’t want people just editing the text file to cheat, so they encrypt these variables in some way in the file and decrypt when they load your game.
Keep in mind you’re keeping track of a lot more than a few variables. Every enemy has an x and y coordinate, a health value (0 to 100), any other important stats, etc.
Latest Answers