Re: New to Game Editor and have ?
Ah, well there are things called variables. They hold information, in this case we are talking about an integer. It holds a number, so you can store values in that number, like 0 or 1, that you can use later. In this case the variable gameState holds the current state of the game. 0 is for unpaused, and 1 is for paused.
Creating a variable:
1. Go to the script editor.
2. Click the button [Variables]
3. Click [Add].
4. Type in the variable name, in this case gameState.
5. (Notice that is is integer) click [Add]
6. Click [Close]
After that the code will work. Here are some simple things you can do to manipulate variables.
Lastly, the most important thing with variable is that you can use them to make events do different things.
The above code will do essentially the same thing that the original code I sent you does. The if statement checks if the variable gameState is equal to zero, and if so execute the code within the {}. If not (else), execute the code after the else. If you want I'll pm you a better description of variables.
Creating a variable:
1. Go to the script editor.
2. Click the button [Variables]
3. Click [Add].
4. Type in the variable name, in this case gameState.
5. (Notice that is is integer) click [Add]
6. Click [Close]
After that the code will work. Here are some simple things you can do to manipulate variables.
- Code: Select all
variable=5; // sets the variable equal to 5
variable+=5; // increases the variable by 5
variable-=5; // decrease variable by 5
variable*=5; // multiplies variable by 5
Lastly, the most important thing with variable is that you can use them to make events do different things.
- Code: Select all
if(gameState==0)
{
PauseGameOn();
gameState=1;
}
else
{
PauseGameOff();
gameState=0;
}
The above code will do essentially the same thing that the original code I sent you does. The if statement checks if the variable gameState is equal to zero, and if so execute the code within the {}. If not (else), execute the code after the else. If you want I'll pm you a better description of variables.