Variables
Last updated
int myvar1 = 100, myvar2; // myvar1 initial value is 100, myvar2 initial value is 0
int myvar3 = 40; // myvar3 initial value is 40
main {
myvar3 = myvar1 - myvar3; // myvar3 value is now 60
}int myvar1, myvar2;
main {
myvar1 = TRUE; //myvar1 = 1
myvar2 = FALSE; //myvar2 = 0;
}int myvar;
main {
if(event_press(XB360_A)) { //if A is pressed on the controller
myvar = !myvar; // here we assign myvar to the opposite of the truthy
// value of myvar meaning if it's 0 it's value will be
// set to 1, otherwise it's going to be 0
}
if(myvar) { //if myvar has a value other than 0 (zero)
//do something
}
}int myvar;
main {
if(event_press(XB360_A)) { // if A is pressed on the controller
myvar = myvar + 1; // increment myvar by 1
}
if(event_press(XB360_X)) { // if X is pressed on the controller
myvar = myvar - 1; // decrement myvar by 1
}
if(myvar == 2) { // if myvar has a value of 2
//do something
}
if(myvar >= 4) { // if myvar has a value of greater than or equal to 4
//do something
}
if(myvar < 2) { // if myvar has a value less than 2
//do something
}
}