am I doing unlock levels correctly? it works but...?

StormyStudioStormyStudio United KingdomMember Posts: 3,989
edited November -1 in Working with GS (Mac)
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

Comments

  • rebumprebump Member Posts: 1,058
    Sounds like you may need to move the "Load Att" behavior for "UnlockedLevels" attribute to like the title screen so it is ready well before the level select screen pops up.

    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).
  • FoleyFoley Member Posts: 37
    here's a workaround idea you could try-

    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.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    I guess that will work, and like rebump says adding a locking sound could be cool.

    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?
  • rebumprebump Member Posts: 1,058
    Yeah, forgot about alpha for making things be visible or not. Good call Foley.
  • synthesissynthesis Member Posts: 1,693
    I believe there is also a visible boolean attribute switch in the actor's graphics attributes...haven't used it yet myself. I assume it makes it visible or not visible. Not sure if it makes the rules lock or not.

    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.
  • synthesissynthesis Member Posts: 1,693
    What if you had your button art on one button that is activated if the level is unlocked.
    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.
Sign In or Register to comment.