Particular Level Unlocking System

  • Having yet to use arrays properly (just a note), I'm trying to figure out the best way to have a level unlock system that works in a certain way. The game would go as follows:

    Select World 1 (all Stages are locked; automatically start with Stage 1) -> Pass Stage 1 and proceed -> Pass Stage 2 and proceed -> Defeat Midboss 1; Stage 1 & 2 are unlocked for replay and proceed -> Pass Stage 3 and proceed -> Pass Stage 4 and proceed -> Defeat Midboss 2; Stage 3 & 4 are unlocked for replay and proceed -> Pass Stage 5 and proceed -> Defeat World Boss; Stage 5 is unlocked for replay and proceed

    Essentially, in order to unlock all of the stages for replay in a world, you have to defeat the midbosses to unlock the previous stages; defeating the world boss would unlock the last stage and the entire world for replay/continue point.

    I really wouldn't know where to begin here. I thought I could use a letter system since the stage numbers are close to all the quantity of letters in the English alphabet, but I'm not sure how to keep work with a variable for both stages AND worlds. Maybe now I can finally figure out how arrays work correctly. Any help would be appreciated

  • I would definitely do this with arrays.

    Each Row would have a World/Stage code. For example, "W1S1" could be world 1 stage one.

    Then there would be two columns: Unlocked and Replay. They would all be set to zero.

    As players complete stages, it would change the array. Completing World 1 Stage 1 would change the W1S2 Unlocked value to 1.

    Defeating a midboss would change the appropriate Replay values to 1. Defeating midboss 1 would change the Replay value for W1S1 and W1S2 to 1.

    Defeating World 1's final boss would change the Unlocked and Replay values for W1S1, W1S2, W1S3, W1S4, and W1S5 to 1. It would also change the Unlocked value for W2S1 to 1 as well (since that's the first stage in the next world).

    Finally, the World Map (or stage select screen, etc) would reflect the current state of the array. For example, stages with an Unlocked value of 0 could be drawn at 50% opacity or in greyscale, and stages that have a Replay value of 0 could have a little lock icon.

    Is that what you're looking for? You could do also this with dictionary entries, if it's more comfortable (just more typing).

  • I would definitely do this with arrays.

    Each Row would have a World/Stage code. For example, "W1S1" could be world 1 stage one.

    Then there would be two columns: Unlocked and Replay. They would all be set to zero.

    As players complete stages, it would change the array. Completing World 1 Stage 1 would change the W1S2 Unlocked value to 1.

    Defeating a midboss would change the appropriate Replay values to 1. Defeating midboss 1 would change the Replay value for W1S1 and W1S2 to 1.

    Defeating World 1's final boss would change the Unlocked and Replay values for W1S1, W1S2, W1S3, W1S4, and W1S5 to 1. It would also change the Unlocked value for W2S1 to 1 as well (since that's the first stage in the next world).

    Finally, the World Map (or stage select screen, etc) would reflect the current state of the array. For example, stages with an Unlocked value of 0 could be drawn at 50% opacity or in greyscale, and stages that have a Replay value of 0 could have a little lock icon.

    Is that what you're looking for? You could do also this with dictionary entries, if it's more comfortable (just more typing).

    Yeah, I figured it was going to come down to arrays.

    One of the issues I had with looking arrays over was I never found a list of tutorials that would explain how arrays could be used for multiple separate things in one project; kind of like how you just have separate event sheets.

    I just quickly found a YouTube tutorial on using an array for a weapon inventory and I'm going to follow that while integrating your World Unlock/Replay concept. I wouldn't have thought of 2 separate values for this but it makes sense. Maybe when I'm done I can get a Hi-Score array working as well.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • OK, I give up on this array thing for creating a level unlock.

    I'm still unsure of how to even label the values to text so that I know what I'm looking at in the debugger. I'm just going to have to look up something more recent that is a general level unlock system with arrays. I did get to understand it a little better but it's still making me nuts. I didn't even know what you could change values in the debugger until now... like 2 years later!

    I was able to come up with a system that is working the way I want without arrays so I can continue with finishing my game. Thanks again.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)