Пример #1
0
def dead(windowSurface):
    option = 0
    reset = 0
    paused = True
    dimmer.dim()
    menu = Menu((480, 51), (255, 255, 204), 
       (102, 0, 0), pygame.font.SysFont('Verdana', 15), ["Load Checkpoint", "Restart", "Exit"])
    while (paused == True):
       menu.update_box()
       pygame.display.update()
       for event in pygame.event.get():
        if event.type == QUIT:
            sys.exit(0) # Clicking the x now closes the game, not ESC
        if event.type ==KEYUP:
        	if event.key == K_ESCAPE:
        	   paused = False
        	if event.key == K_DOWN:
        	   menu.next_down()
        	if event.key == K_UP:
        	   menu.next_up()
        	if event.key == K_RETURN:
        	   option = menu.get_position()
        	   if option == 0:
        	      paused = False
        	      return reset
        	   if option == 1:
        	      reset = 5
        	      paused = False
        	      return reset
        	   if option == 2:
        	      sys.exit(0)
    dimmer.undim()
Пример #2
0
def pauseBalls(windowSurface): #by going up stairs, pauseballs, by going down stairs
    my_font = pygame.font.SysFont('Verdana', 15, True)
    option = 0
    reset = 0
    paused = True
    dimmer.dim()
    menu = Menu((480, 51), (255, 255, 204), 
       (102, 0, 0), my_font, ["Resume", "Restart", "Exit"])
    while (paused == True):
       menu.update_box()
       pygame.display.update()
       for event in pygame.event.get():
        if event.type == QUIT:
            sys.exit(0) # Clicking the x now closes the game, not ESC
        if event.type ==KEYUP:
        	if event.key == K_ESCAPE:
        	   paused = False
        	if event.key == K_DOWN:
        	   menu.next_down()
        	if event.key == K_UP:
        	   menu.next_up()
        	if event.key == K_RETURN:
        	   option = menu.get_position()
        	   if option == 0:
        	      paused = False
        	   if option == 1:
        	      reset = 1
        	      paused = False
        	   if option == 2:
        	      sys.exit(0)
    dimmer.undim()
    return reset