How do I variables?

Get help using Construct 2

Post » Mon Jun 15, 2015 9:58 am

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
Posts: 1
Reputation: 177

Post » Mon Jun 15, 2015 10:08 am

Every tick:
-Set text: "Score"&Variable

For the health bar it should be the same.
I hope I could help! :)
Posts: 198
Reputation: 1,073

Post » Mon Jun 15, 2015 5:14 pm

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.
Posts: 1,209
Reputation: 7,537

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 61 guests