优化交互
This commit is contained in:
1 parent
009c591054
commit
c1984518d7
1 file changed
+6
-3
@@ -24,7 +24,7 @@ class MainMenuScene(BaseScene):
|
||||
font_file = os.path.join(data_path(),"Dymon-ShouXieTi.otf")
|
||||
self.font = pygame.font.Font(font_file,16)
|
||||
# 文本
|
||||
self.game_info_text = self.font.render('按任意键开始游戏,鼠标点击退出', True, Color.white)
|
||||
self.game_info_text = self.font.render('按任意键开始游戏,ESC退出', True, Color.white)
|
||||
|
||||
# 雨滴列表
|
||||
self.rain_max = 50
|
||||
@@ -59,9 +59,12 @@ class MainMenuScene(BaseScene):
|
||||
接收主循环传来的事件并处理
|
||||
"""
|
||||
if event.type == pygame.KEYDOWN:
|
||||
self.button_status = True
|
||||
if event.key == pygame.K_ESCAPE:
|
||||
return "exit" # 主循环接收返回,为exit时设置running为False,退出游戏
|
||||
else:
|
||||
self.button_status = True
|
||||
elif event.type == pygame.MOUSEBUTTONDOWN:
|
||||
return "exit" # 主循环接收返回,为exit时设置running为False,退出游戏
|
||||
self.button_status = True
|
||||
|
||||
def __show(self, info, dest=(0, 0)):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user