• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker An easy way to save many collectables?

0TastyPie0

Member
So I have a platformer game where you can collect a specific collectable that is then saved in an ini file (if collected or not). One variable for each collectable. It's geting really hard to keep track of so many variables, is there an easier way (without having to have one variable for each)?
 

TheouAegis

Member
If you can work it out in bits, you can reduce the number of variables you need drastically. Depending on how many collectibles you have,have you would set up an array whereby each index in the array can hold up to 32 collectibles. so then you would just need to store in a variable in each collectible the bit that you were going to set aside in each index of the array for that item. Optionally, you would also store in a variable in each collectible the index of the array that it uses. I say this is optional because you could, for example, have each index of the array be every four levels, for example. So you wouldn't need to store the index in the item in that case.
 
Top