"state=" is both a condition and an action.
The first use of
state= in a line of code:
:state=0
is a condition. In other words, what is the condition of
state?
if
state = 0 is true, then the condition is true.
Since all scripts initialize state at "0", it would be true.
If the condition is true, the engine will process that line of code.
If the condition is not true, the engine will skip that line of code.
The second use of
state= in a line of code:
state=1
is an action. It does something. It changes the value of state to "1"
Now the engine will only process line of code in which the condition is
state=1.
Put simply,
state= is a way of advancing your script to the next level, somewhat like line numbers.
Content and tools for games