Game Development Community


#1
07/15/2007 (8:15 am)
Here :

yourt2dscenegraph.setscenepause([true for pause - false to unpause])

or/and

$timescale = [0 to pause - 1 to unpause]
#2
07/15/2007 (2:56 pm)
I took your advice, and created a "simple" function for that...

function gamePause(%state)
{
   %paused=$pShip.scenegraph.getscenepause();
   switch$(%state)
   {
      case "pause":
         if (!%paused)
         {
            $pause=$mGUI.createTextTag(1, 2, "center", 10, 1, 0.80);
            $pause.text="*** GAME PAUSED ***";
            $pause.setPosition(0,0);
            $obj.scenegraph.schedule(150,  "setscenepause", true);
         }
         else
         {
            $pause.safeDelete();
            $obj.scenegraph.setscenepause(false);
         }
      case "release":
         return;
   }
}

with that lil function, you can bind a key (say "P") to that function and it will pause the game and show an onscreen message.
#3
07/15/2007 (5:51 pm)
Thanks very much for the help! That $timescale setting could be useful too - I never knew you could slow the game down!