Save attribute messing up my levels!

JScottJScott Member Posts: 143

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

Sign In or Register to comment.