How do I store level data, array perhaps

0 favourites
  • 4 posts
From the Asset Store
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • Hello,

    Lets say I have a layout with 5 square sprites on it. Each square would be a different color on the start of each level and I would like to store these for example like this:

    Level 1 - Orange, Yellow, Blue, Red, Green

    Level 2 - Brown, Pink, Yellow, Red, Blue

    Level 3 - Green, Yellow, Red, Blue, Pink

    I just want a single layout that I can use over and over again with the data above. So when the game starts it will load level 1 data and color the squares as indicated. When the player completes level 1 it will then grab the data for level 2 and color the squares accordingly...and so on.

    How is best to store this information and get it when needed.

    If anyone can also give me a basic example capx or something that would really help.

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't think array is required here in any way.

    If that's as simple as it sounds you can just create global variable for all levels.

  • Use an array where the index of "X" axis is your level (ZERO base, so, index + 1) and "Y" is used to store sprite colors.

    Then, in each "On Start Layout" you set the animation to the value at Array[level][sprite], where the value "sprite" is an instance variable you set before to each Sprite.

  • Thanks I'll give those a try.

    The game is basically a puzzle game where on each level the player is shown a number of colored squares and then after X seconds the squares go blank and the player must replicate the colors they were shown.

    So I just need a way of storing each level/stage of colors and then check the players 'input' to see if they match in order to progress to the next level.

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