How do I work with stars without array

  • I was looking for the same. Tbh i read some guides about arrays but i cant really comprehend arrays.

    Maybe i will use frames and let you know if it works but as i have a full time job it will take quite some time.

    Thanks mate. Take your time. By the way that video I have checked it already. I can easily copy that method without understanding arrays but that is not what I wanted to do.

  • shinkan if possible could you show me a demo for the star count.

    If possible.

  • I used Dictionary object instead. For two reasons:

    1. It's may be simpler to use than Arrays for you

    2. [attachment=0:2at88d4g][/attachment:2at88d4g]

    You can't do something like that with global or instance variables.

    ...now I think I may accidentally make this a little bit to complicated for you xD

    But you need to learn this anyway sooo ;P

  • shinkan thanks mate. I have checked what you have done. It's quite interesting. I have also checked the manual on dictionary.

    I need to stop changing the stars when it is already received higher stars

    And

    Also the star counts in the levels page.

    But how to add stars to the star count and not add again and again for the same level.

  • animator I have followed your other post - . Now I am just wondering how to do that for this situation. shinkan - How to add the stars to the star count only once, not every time it is achieved. And also if two stars are gained, it will says total stars gained 2. If the player plays the same level and gained three stars this time. It should say total stars gained 3 not 5 by add the new 3 stars.

  • animator I have followed your other post - . Now I am just wondering how to do that for this situation. shinkan - How to add the stars to the star count only once, not every time it is achieved. And also if two stars are gained, it will says total stars gained 2. If the player plays the same level and gained three stars this time. It should say total stars gained 3 not 5 by add the new 3 stars.

    I've add one line to my previous example. Now you can only add Stars that are greater than current level score.

  • Thanks a lot. I will check soon. shinkan You're the life saver. But sorry for asking this, is there any possibilities to do this without using arrays or dictionaries, just with global variables or greater than, lesser than conditions. Just to know, I couldn't quite catch a way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot. I will check soon. shinkan You're the life saver. But sorry for asking this, is there any possibilities to do this without using arrays or dictionaries, just with global variables or greater than, lesser than conditions. Just to know, I couldn't quite catch a way.

    Yes, it is possible to do that with global variables but you would need a few for each level, and the you will have quite a lot messy event to compare and set things up.

    While using dictionary you can do that a lot easier. In my example I've "pre-made" few keys at start of the first layout for simplicity, which is not optimal if you have ie. 100 levels. And here's come advantage of Dictionary over Global Variables. You can not set new Variables at runtime, but you can set new Dictionary keys at runtime. This means for every new level you can make new keys with some values and use them later in your game.

    Backing up to global variable. There are few ways to set this up using only a couple of variables, but it needs a bit more knowledge and few hardcore events - do not recommend this for beginners

  • shinkan thanks a lot

  • shinkan thanks for the valuable explanation.

  • animator

    You are welcome.

  • shinkan sorry to bump again. When you have time to spare, Can you show me a demo of just the star count in the levels page using global variable. Don't worry about the stars to be displayed.

  • animator

    Using Global Variables instead of Dictionary?

  • Yes just the star count in the levels page.

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