How do I variables?

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I am making a game and I ran into two problems:

    1-I have a variable to a score text box and I want to make it that every tick the text changes to ("Score: " & [variable])

    2-I have a health bar and I want it to constantly update the progression to the same value as my variable almost like my text box but with a healthbar

  • Every tick:

    -Set text: "Score"&Variable

    For the health bar it should be the same.

    I hope I could help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aquadijoib solution should work.

    However you are better off getting used to not use every tick for something like this. Even though it in this case shouldn't hurt to much, but as you start adding more and more things to every tick events then you will loose performance in the end.

    Since you only need the score to update whenever the score changes making a function that update it for you will be a better solution. And you just call this function whenever it have changed same goes for your Health bar.

    If you are unsure how to use functions I would highly recommend you to learn how to before you get to far into your game.

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