instance variables

Get help using Construct 2

Post » Thu Oct 31, 2013 12:44 am

hi to all! although i have read many times the manual and the forums i still need your help to fully understand some expression for instance variables. i have lets say two in one object(boo) true or false. when i i go to the event sheet i pick that object and compare instance variable it is blanc.it says first create an instant variable. why? second, what is instance variable expression? thank you
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Thu Oct 31, 2013 2:12 am

Boolean instance variables is accessed via "Is boolean instance variable set". As far as I know, "Compare instance variable" only works if you're comparing string or number variables.

I'm not sure what you mean by instance variable expression?
B
10
S
3
G
1
Posts: 11
Reputation: 1,554

Post » Thu Oct 31, 2013 5:44 am

Select a sprite you have added to your layout...
(Either from the layout directly or from Project or Object Panel)

On the "Properties" panel you have various properties you can edit such as the name its layer angle etc

One of these sections is called "Instance Variables"

Under this section you can add variables that are directly attached to the object... rather than creating local and global variables in the event sheet.

If the sprite is your player you might add a "health" value or something similar

https://www.scirra.com/manual/73/instance-variables
B
8
S
3
G
1
Posts: 34
Reputation: 1,395

Post » Thu Oct 31, 2013 10:45 am

@synckdot. you are right only numbers and strings can be compared . now for the "is Boolean instance variable set" what is its purpose and what does it do exactly?any example would be greatly appreciated
B
15
S
6
G
4
Posts: 277
Reputation: 3,948


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests