Pause
Blitz3D Forums/Blitz3D Programming/Pause| 
 | ||
| Anyone have proper solutions for pausing a 3D game? 
global key = 0
global pausekey = 25
while not key = pausekey
    key = waitkey()
wend
like solutions doesn't work for me.Especially after loading, when level starts, everything appears to be started moving, AI attacking etc. until it starts to render something to the screen.So I want to add a "press a key to start" on each level.Pausing during the game is needed also. I hope you will understand what I mean.Thanks. (code above is just an example, I don't know even if it's working lol) | 
| 
 | ||
| I don't completely get what you mean. Maybe you could pause everything that moves in the game ? Sort of like this: 
Repeat
   If not keydown(pausekey) Then
     UpdateWorld
     UpdateGame   ;AI etc.
     UpdatePlayer ;controls etc.
   End If
   RenderWorld
   Flip
Forever
 | 
| 
 | ||
| .mainloop while exit=false and pause=false if keyhit(1) then exit=true if keyhit(57) then pause=true wend repeat if keyhit(57) then pause=false until pause=false goto mainloop this might work | 
| 
 | ||
| try this 
pausekey=25
while not keydown(1)
  print"hi"
   if keyhit(pausekey)
     flushkeys
      repeat
      until keyhit(pausekey)
   endif
  print"bye"
wend
 | 
| 
 | ||
| I have something like this if keyhit(57) then gotosub pause renderworld flip wend end pause while not keyhit(57) renderworld flip wend return | 
| 
 | ||
| Or like this: PauseMode=False While Not Keyhit(1) If PauseMode=False ;Do everything If KeyHit(PauseButton) PauseMode=True Else ;Pause Screen If keyhit(PauseButton) PauseMode=false end if wend | 
| 
 | ||
| if keyhit(pausekey) while not keyhit(pausekey) wend endif | 
| 
 | ||
| wow, just use ONE of these, okay Mortiis? | 
| 
 | ||
| Yahfree won :P His example works best for my code. Thanks everyone. |