I think is_pressed()
in manual()
doesn't wait for your press so you call mainloop()
so I think you never leave that loop.
I see other bad ideas in your code like:
menu()
callmanual()
which callmenu()
which callmanual()
etc. - usereturn
and use loop inmenu()
- every time you call
menu()
you callpygame.init()
andpygame.display.set_mode()
- you should use it only once.
EDIT:
I don't know how games.keyboard.is_pressed()
works (because there is no that function in PyGame) but I think manual()
could be:
def manual():
image = games.load_image("options.jpg")
games.screen.background = image
while not games.keyboard.is_pressed(games.K_b):
pass # do nothing
# if `B` was pressed so now function will return to menu()
and you have to create loop in menu:
running = True
while running:
choose = dm.dumbmenu(screen, [
'Start Game',
'Manual',
'Show Highscore',
'Quit Game'], 220,150,None,32,1.4,green,red)
if choose == 0:
main()
elif choose == 1:
manual()
# if 'B' was press manual() will return to this place
elif choose == 2:
print("yay")
elif choose == 3:
running = False
print ("You choose Quit Game.")