Unable to use global variables

For questions about using Classic.

Post » Mon Oct 04, 2010 1:35 pm

http://i51.photobucket.com/albums/f355/ ... iables.png

For the layout's width, I've tried writing
Stage 0 Width
and
"Stage 0 Width"
but they are not accepted.

How do I use global variables in this case?
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Mon Oct 04, 2010 1:48 pm

Check a couple of tutorials provided on site, and all will be just a little easier to understand.
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Oct 04, 2010 2:11 pm

May I know which tutorials exactly? I've already checked out a couple of them (Ghost Shooter and Crazy Robbie) and they don't use global variables.
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Mon Oct 04, 2010 2:16 pm

Check deadeye's Platform School, great tutorial
[url:1m1li7hv]http://dl.dropbox.com/u/9498285/Platform%20School.zip[/url:1m1li7hv]
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Tue Oct 05, 2010 1:10 am

[quote="pooiyx":2o3pj8d7]http://i51.photobucket.com/albums/f355/pooiyx/howtouseglobalvariables.png

For the layout's width, I've tried writing
Stage 0 Width
and
"Stage 0 Width"
but they are not accepted.

How do I use global variables in this case?[/quote:2o3pj8d7]

For the record, if you are using it in an expression, it would be:

global('Stage 0 Width')

Otherwise, if you use the Compare global variable system condition, you just select it from the drop-down list.

Note the use of the single quotation marks. They are reserved for identifying variables in Construct. Also, be careful of using whitespace in the names. Make sure that you don't have extra spaces or whatnot... I prefer not to use spaces in names (i.e.: Stage0Width.) Not sure if I've ever tried it, actually. ;)
B
3
S
2
G
2
Posts: 187
Reputation: 1,449


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests