Ok... I wanted to do that for my game too anyway, so I did it earlier that I have planned...
Here it is:
I am assuming that you have used the wme_Demo as a reference/template for your game
find in the game.script the code
on "Keypress"
{
.......
.......
}
And put inside that code the following code:
// on space, pause the game
if(Keyboard.KeyCode==VK_SPACE || Keyboard.Printable==false)
{
WinCaption.Visible = false;
var WinPause = Game.LoadWindow("interface\system\pause.window");
WinPause.Center();
//the GoSystemExclusive pauses everything except the loaded window
WinPause.GoSystemExclusive();
Game.UnloadObject(WinPause);
}
OK... now all we need is to create the pause.window and ofcourse it's script, pause.script
Go to interface/system directory and create those two files:
pause.windowWINDOW
{
WIDTH = 100
HEIGHT = 100
NAME = "pause"
SCRIPT = "interface\system\pause.script"
}
pause.script#include "scripts\base.inc"
#include "scripts\keys.inc"
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
if(Keyboard.KeyCode==VK_SPACE){
self.Close();
}
}
That's it!
Ofcourse you could add more things to make it better. For example you could load an image in the window that says something "game is paused, press space to return" etc
EDIT: Ofcouse what I did was the same as McCoy suggested, but I think that a "ready" code might be simplier to understand