How do I create a OS dock that is populated dynamically

  • Goal: An operating system-like taskbar/dock that will start empty and be populated with applications/icons as they unlock throughout the game. Applications could be marked or added to some data structure and the dock will update to list all elements in the grouping.

    Problem: Currently, I am making each application manually and adding the application to the dock in the "On start of layout". Each application has a boolean to determine if it is unlocked yet and whether to display it. This will become bulky and require a lot of duplicate code later on when there may be dozens of dock elements.

    Question: Is there a data structure or method I could use where I could add a newly unlocked application to a list/set a variable/add to a group/etc... and the dock will automatically add or remove elements so it matches the list?

    I have searched quite a bit for a similar thread and have not found anything. Please excuse me if this has been asked before!

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Generally, processing code is a relatively light process. You really could just set your dock up with code like

    >If App is Unlocked >Show icon

    >Else >Destroy icon

    (to put it very crudely). There isn't really a need to have it trigger on layout starts and then have to figure out how to re-trigger it later on in the same layout.

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