Topic was automatically imported from the old Question2Answer platform.
Asked By
Idleman
I am working on the dialog system for my game. I want the players and enemies/NPC to stop movement when in dialog mode. Currently thinking taking a pause to the game when playing dialog, but want to get some advise if there is other better way to achieve that. Thank you.
Hi,
that strongly depends on your program flow.
If you want to completly halt gametime, using pause seems to be a pretty good approach.
If animations and other npcs should continue to move and act you need a different approach,
When you want to restrict processing only on certain game elements you can ether branch your tree and set the pause mode corespondingly,
Or you can implement a master object wich calls all the objects to update and stop those objects by not calling them to update.
Or make a singleton and set a pause flag and whenever a object wants to update it first checks this flag.
… sure there are many more ways to archive this …
Thank you for your suggestions, I will first try the pause approach.