Tag Archives: add

Instance Variable

Each one of object name have their own properties of variable to holds some value. Value of these variable can be a number, text and boolean (true or false). Variable in an object works as “Local Variable”, so it will not interrupt another variable (in different object) which have the same name.
*Note : Even though its “Local”, but please use different keywords with Global Variable (if you already have it) to avoid unexpected error.

1. Make an Instance Variable by open this window. Left click on your object and then choose “Instance Variable” from object type properties. An Instance Variable window will pop up like this. Look at the picture, I already give some unique mark on it. There are red, green, and blue mark which have different action for each. Red mark is for add a new variable, green mark for edit the selected variable, and blue mark is for delete the selected variable. List of variable you have made will be displayed on a table below.
SS016

*In this tutorial I will only use number for the object variable type, because it can represent both boolean or text.
SS017

2. Give your variable a name that represent the usage of variable. Mention initial value for your variable if needed.  Example, I have an aircraft (plane) here which have health point as one of its element so I will named these variable as “health”. Initial “health point” for fresh and mint condition is 100 points, so I will put 100 as it “Initial Value”.
SS018

You can close this window if you have finished editing variable inside. If there any missed variable, you can simply open this window again by following step 1.