我想要做的是,我想在初始窗口中选择不同的小游戏作为选项。因此,无论用户选择何种游戏选项,该游戏都将在同一窗口中运行。这是可能的,如果是这样的话呢?
答案 0 :(得分:0)
这可能是你想要的伪代码:
class Menu():
#Has all menu-related knick-knacks
def main(screen):
if on_main_menu == True:
Menu.draw(screen)
if Menu.start_button_1.is_pressed:
on_main_menu = False
playing_game1 = True
if Menu.start_button_2.is_pressed:
on_main_menu = False
playing_game2 = True
while playing_game1:
#play the epic game
while playing_game2:
#play the even more epic game