6) Pause:
Dunno if I got that logic right. What I did was:
On "Pause" pressed - System: Set Time Scale to 0
That works. Then I want to set the Time back to 1 if I hit "Pause" again. So my thought was:
On "Pause" pressed, Timer is equal to 0 - System: Set Time Scale to 1
I guess my thought process is wrong in that case, right?
2) The 'GoldValueField' - I have a HUD with a Text called 'Gold' - underneath it, I wanted to create a text object (called 'GoldValueField') that displays the Gold value from the 'Gold' global variable that I set. So I created a:
Start of Layout - goldValueField: Set text to global('Gold')
Now, it seems to work, since it displays that global variables initial value (0)
Then I created a 'coin' object and wanted to add '10' to the Gold global variable whenever a coin is collected, so I created this event:
Player overlaps Coin - System: Add 10 to global variable 'Gold'
Didn't work. I grab the coin, but the goldValueField doesn't update. It still says '0'
The curious thing is that the same event works for private variables.
I have a 'heart' object and created the following event:
Player overlaps Heart - Player: Set 'Hearts' to 1
And I have a heart icon in the hud that has 2 animation frames. If the 'Hearts' Private Variable is set to 0, it displays the EmptyHeart Frame. If the 'Hearts' variable is at 1, it displays the full heart.
This works. It's the same logic behind both events, it works for private variables, but doesn't seem to work for global variables. What am I missing here?