How do I allow the player to cycle through unlocked options?

0 favourites
  • 3 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hi there, back again for a little advice and a hope that I'll be pointed in the right direction as I'm sure I'm thinking about this incorrectly.

    In our project we have the functionality for the player to have multiple weapons. These weapons are collected during the game and a boolean is set to true for each one that is unlocked. There's six in total.

    The current weapon is stored in a string called "costume_name"

    When the player presses a button we would love it if the player cycles through the unlocked weapon boolean

    So if the current "costume_name" is X and the player has already unlocked Y (that boolean now being true), when they press a button the costume_name variable is changed to Y.

    However, if they haven't unlocked Y (as in the boolean isn't true) but they have unlocked Z (that boolean is true) then the "costume_name" is set to Z.

    And the cycle continues so the player can tap a button and quickly cycle through the unlocked weapons.

    This is what the code looks like currently, but it just doesn't add anything to the costume_counter

    Thank you, hopefully I explained myself well enough here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A quick guess would be that since you aren't using "Else" anywhere here, every single one of these events run upon triggering, and you end up with costume_counter=0 after the completion of the last one.

  • You'd be right there. I've added them in and I can see the counter increasing, however the costume_name variable never changes (or doesn't seem to)

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