Jump to content

Pausing the game without using Time:Pause()


wardtf
 Share

Recommended Posts

So I want the game to pause (and specifically FPSplayer.pfb) when

 

self.currentState == "menu" or "splash"

 

So I want the moving gun animation to stop, I want it to ignore key presses and mouse movement, I want it to ignore mouse clicks. Basically, I want it to freeze up when app.currentState is not "game"

 

Any ideas?

: : i7 4700mq : : GT 745m : : 8GB : : Steam : :

Link to comment
Share on other sites

In App.lua try only calling the following when not paused.

 

if self.paused == false then

--Update the world

self.world:Update()

end

 

Now you can pause and unpause with the self.paused variable and setting it to true. Define that variable as false in App:Start(). Note that this would stop ALL entity scripts so your paused code can't be inside entity scripts but would need to be in App.lua.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...