You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating the game and in the examples is only possible to close the game exiting the process, but I want to close one game and start another
When I see the code to instance.exit(), in the final the method call process.exit()
There is a way to close the game without close the process?
Can I make a PR to change this?
The text was updated successfully, but these errors were encountered:
Hey, sorry for delayed response. Thanks for using my lib! :) In general you should treat the instance of terminal-game-io as monitor and keyboard. As long you needs it it's alive. The logic of switching games should be inside your code. You don't delete your monitor and keyboard everytime you run diferent game in your operating system :) You just kill the process of one game and start another - monitor and keyboard is untouched until you reallly want to turn off the machine.
Just add another layer of abstraction in your code - something like Game class. Every game instance will use one instance of terminal-game-io as IO. There could be some menu that wraps everyting with list of games and something like "Quit to terminal" option which would run instance.exit() to really kill whole app.
Hello man
I'm creating the game and in the examples is only possible to close the game exiting the process, but I want to close one game and start another
When I see the code to
instance.exit()
, in the final the method callprocess.exit()
There is a way to close the game without close the process?
Can I make a PR to change this?
The text was updated successfully, but these errors were encountered: