Questions about Global Variables

For questions about using Classic.

Post » Mon Dec 07, 2009 3:12 am

I'm creating a game that has a "Life" Global Variable that I want persistent throughout all of the layouts.

First of all, I want to display the value of "Life" in a text box, but I'm having trouble doing so. So far I have [code:m4haskfd]"Lives: " &[/code:m4haskfd]
How would I add the value of "Life" to that?

And also, I want an event for when "Life" goes below 1, but I don't know how to do that either. Can anyone help with this?
B
1
G
3
Posts: 3
Reputation: 831

Post » Mon Dec 07, 2009 3:41 am

Have you tried the Ghost Shooter tutorial? It covers some of this.

For lives you want:
"Lives: " & global('Life')

There's also a condition in the system object to compare a global variable.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Mon Dec 07, 2009 1:51 pm

Thank you! I knew it was going to be something really simple, but I just couldn't find it anywhere in the documentation or on here.
B
1
G
3
Posts: 3
Reputation: 831


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests