Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚开始开发 PyGame。使用 Python (Captain Obvious Strikes Again)
我的主菜单已经全部设置好了。
它会显示一条文字:准备好后按空格键。所以基本上,我想制作一个事件,当用户按下空格键时触发并打开一个新窗口。关闭上一个窗口。我知道有办法做到这一点,但怎么做?
要清除窗口,请执行以下操作:
Pseudocode: def startGame: if buttonPressed = True: screen.fil(256, 256, 256) else: screen.blit(buttonImage, (x, y)
之后,绘制游戏或其他任何东西。