Global Variables to Local Variables.

Discussion and feedback on Construct 2

Post » Tue Jan 28, 2014 8:17 am

If you notice I made some global variables, I would move these global variables into a group and they become local variables.

Then run the game, the local variables are broken.

Do you know why?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Tue Jan 28, 2014 9:14 am

Make them static
B
57
S
19
G
10
Posts: 191
Reputation: 9,636

Post » Tue Jan 28, 2014 9:23 am

@Kurz It worked!

I'm still unaware about "static" option... What does "static" mean? and What happens if is not "static"?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Tue Jan 28, 2014 9:29 am

What I know from C++ that static variables still exist after you leave the cycle, to example. But just local variables are destroyed.
B
57
S
19
G
10
Posts: 191
Reputation: 9,636

Post » Tue Jan 28, 2014 9:43 am

@Kurz Thanks for clearing that!
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests