Save attribute messing up my levels!
Hi all, so I'm sure it's me messing up my levels, but it's only since I've added the save attribute to save completed levels. Seems simple, but is acting weird.
So in my game, you need to complete a level to advance to the next. After completed, you can choose earlier completed levels to replay. So i have the level unlock working well, until I added the save attribute to record saved levels.
So at the end of the level: game.level+1. If game.level > game.savedLevel, change savedLevel to level. The level unlock is based on saved.level.
When I also save attribute (savedLevel) it unlocks weirdly. Usually the next 2 levels unlock, but sometimes 1 (which is normal).
Any ideas? I have a Table save already, so thinking of just adding the saved level to that. Anyone tried that?
Cheers,
Jason
Comments
Thanks @uptimistik. I will try that. So, does the save attribute have strange results sometimes? Just trying to figure out where i went wrong.
Age of Dominion RTS for iOS
Age of Dominion RTS for Android