A question about saving self.Attributes
juzcook
Member Posts: 259
I've just been playing around with saving and I've stumbled upon something that's causing a hiccup... or for me to create hundreds more Game Attributes. Basically I'm working on a platformer, where there are 3 different awards for each level (hidden items etc). I've set the level select screen up like this:
When Level = 1
Check if Item1.Collected = true
Check if Item2.Collected = true
Check if Item3.Collected = true
Then each item has a self.Unlocked? Boolean which checks what I mentioned above and is then saved and loaded when the scene starts. Each level has 3 different "medals" attached to it.
My problem is that the first time I play through the level and only collect one or two of the items, the level select screen displays correctly which items were collected. BUT if I go back to play the game and click the Menu button to go back to the level select screen (or just finish the level again the same way), they ALL light up, when some of them weren't ever acheived.
So is this a problem that's happening because I'm saving a self.Attribute rather than a Game.Attribute? If I have to make 3 Attributes per level, and I end up having 50 Levels, that's an extra 150 Attributes sitting annoyingly in my list. Am I doing something wrong?
I hope I made sense!
When Level = 1
Check if Item1.Collected = true
Check if Item2.Collected = true
Check if Item3.Collected = true
Then each item has a self.Unlocked? Boolean which checks what I mentioned above and is then saved and loaded when the scene starts. Each level has 3 different "medals" attached to it.
My problem is that the first time I play through the level and only collect one or two of the items, the level select screen displays correctly which items were collected. BUT if I go back to play the game and click the Menu button to go back to the level select screen (or just finish the level again the same way), they ALL light up, when some of them weren't ever acheived.
So is this a problem that's happening because I'm saving a self.Attribute rather than a Game.Attribute? If I have to make 3 Attributes per level, and I end up having 50 Levels, that's an extra 150 Attributes sitting annoyingly in my list. Am I doing something wrong?
I hope I made sense!