简体   繁体   中英

Clear previous screen to show next screen pygame

I am trying to develop GUI for a who wants to be a millionaire game using pygame. If the user is presented with the welcome screen and clicks new game, it should clear the welcome screen and bring up the main game screen.

I tried using os.system('xxx.py') but it doesnt stay on, it just flashes and goes off. Any ideas on how to make this work?

Thanks in anticipation.

You probably shouldn't be trying to launch a new instance of your game. You should create a reset method which can be called to restart everything. It would clear all variables, set the game state back to the start, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM