Pausing and Creating Actors... help please!
Posted: Thu Sep 20, 2007 1:50 am
I am trying, by script, to create a "paused" actor that appears on the "p" Key-Down Event, which is pause. So basically when the user presses "p", not only will the game be paused, but the word "paused" will appear on the screen as well.
The problem is that the code I have created works one way, and not the other. Yet, the one way it works is the opposite of what I want it to do. What happens is that the "paused" appears on unpause, and doesn't delete(destroy); you can simply think that... "Ooh, just switch the script around.." but that does not work.
Here is the script that DOES work, but not the way I want it to work:
Here is script that does NOT work:
Does anyone have any tips or answers to my problem?
The problem is that the code I have created works one way, and not the other. Yet, the one way it works is the opposite of what I want it to do. What happens is that the "paused" appears on unpause, and doesn't delete(destroy); you can simply think that... "Ooh, just switch the script around.." but that does not work.
Here is the script that DOES work, but not the way I want it to work:
- Code: Select all
if(pause == 0)
{
DestroyActor("Paused");
PauseGameOn();
pause = 1;
}
else
{
CreateActor("Paused", "icon", "(none)", "(none)", -105, -41, true);
PauseGameOff();
pause = 0;
}
Here is script that does NOT work:
- Code: Select all
if(pause == 0)
{
CreateActor("Paused", "icon", "(none)", "(none)", -105, -41, true);
PauseGameOn();
pause = 1;
}
else
{
DestroyActor("Paused");
PauseGameOff();
pause = 0;
}
Does anyone have any tips or answers to my problem?