Pausing an application

Blitz3D Forums/Blitz3D Beginners Area/Pausing an application

1) Monitor for a spacebar keypress
2) When it happens, change a global gamestate variable to a value (of your own choosing) that signifies "paused"
3) When it comes time to draw your screen, instead of rendering the game display, render a paused display instead.
4) When unpause occurs, change the gamestate variable to "playing"

So in your loop (that occurs multiple times per second), you would have something like this (perhaps):
Const GS_PLAYING = 0
Const GS_PAUSED = 1
Global gamestate = GS_PLAYING

While Not KeyHit(1)
  Select gamestate
    Case GS_PLAYING
      ; Draw Game, check for game keypresses, etc
    Case GS_PAUSED
      ; Draw paused screen, check for unpause keypress, etc
  End Select
Wend