am I doing unlock levels correctly? it works but...?
StormyStudio
United KingdomMember Posts: 3,989
Ok, so I'm attempting to do unlock levels for my game.
Have a page, with 20 level buttons, each has a padlock image over it.
There is an unlockLevels integer game attribute.
When a level is succeed I add 1 to this attribute,
it also saves this to a UnlockedLevels Key.
On the level select screen, it loads, you see all the padlocks, then after half a second or less, the unlocked padlocks disappear.
How can I make it so they have already disappeared? and you dont see them disappear.?
Hope that makes sense, basically the functionality works fine but it looks a bit amateurish as it is.
Cheers
Have a page, with 20 level buttons, each has a padlock image over it.
There is an unlockLevels integer game attribute.
When a level is succeed I add 1 to this attribute,
it also saves this to a UnlockedLevels Key.
On the level select screen, it loads, you see all the padlocks, then after half a second or less, the unlocked padlocks disappear.
How can I make it so they have already disappeared? and you dont see them disappear.?
Hope that makes sense, basically the functionality works fine but it looks a bit amateurish as it is.
Cheers
Comments
If that doesn't cure it (since GS may still lag a bit when removing the padlock image), you may want to have the level images spawn a padlock image over itself it it is locked (although this may produce the same effect only in reverse...i.e. they are all unlocked for a second but then the locked ones show up locked...which could look cool with a prison door shutting sound effect).
Or you could just update the image between the two unlocked/locked images depending on the level's state (if you are doing this already, please forgive...by the sound of your post, it seems like you may be using a padlock actor overlay over the levelselect actors).
initially set the padlock alpha to 0.
Then drop in a 1 second timer:
- After 1 second, IF the level is unlocked, change alpha to 1.
So initially no locks appear. After one second, the locks on the locked levels will appear.
You can play with the timer duration, you might need less than half a second to avoid the flicker.
Makes me wonder how its done in other GS games, looks like it works fine in Kill the King, you dont see padlocks appear or disappear?
Changing alpha does not disable the rules (button still works for example)...not sure if changing visible will make the rules dis-functional until it is visible again...which could be a good thing and a bad thing...depending on the rules.
Then have a second actor on top of that of the lock. If the level is unlocked, then lock actor is not visible and button is activated...vice versa for locked.