develop
Mix 3 years ago
commit 53f63cba27

@ -57,10 +57,12 @@ def starting_screen():
WIN.blit(game_title, (WIDTH//2 - game_title.get_width()//2, 150)) WIN.blit(game_title, (WIDTH//2 - game_title.get_width()//2, 150))
play_button = Button('Play!', WHITE, None, 350, centered_x=True) play_button = Button('Single Play!', WHITE, None, 350, centered_x=True)
exit_button = Button('Exit!', WHITE, None, 400, centered_x=True) Oplay_button = Button('Online Play!', WHITE, None, 400, centered_x=True)
exit_button = Button('Exit!', WHITE, None, 450, centered_x=True)
play_button.display() play_button.display()
Oplay_button.display()
exit_button.display() exit_button.display()
pygame.display.update() pygame.display.update()
@ -68,16 +70,22 @@ def starting_screen():
while True: while True:
if play_button.check_click(pygame.mouse.get_pos()): if play_button.check_click(pygame.mouse.get_pos()):
play_button = Button('Play!', RED, None, 350, centered_x=True) play_button = Button('Single Play!', RED, None, 350, centered_x=True)
else: else:
play_button = Button('Play!', WHITE, None, 350, centered_x=True) play_button = Button('Single Play!', WHITE, None, 350, centered_x=True)
if Oplay_button.check_click(pygame.mouse.get_pos()):
Oplay_button = Button('Online Play!', RED, None, 400, centered_x=True)
else:
Oplay_button = Button('Online Play!', WHITE, None, 400, centered_x=True)
if exit_button.check_click(pygame.mouse.get_pos()): if exit_button.check_click(pygame.mouse.get_pos()):
exit_button = Button('Exit!', RED, None, 400, centered_x=True) exit_button = Button('Exit!', RED, None, 450, centered_x=True)
else: else:
exit_button = Button('Exit!', WHITE, None, 400, centered_x=True) exit_button = Button('Exit!', WHITE, None, 450, centered_x=True)
play_button.display() play_button.display()
Oplay_button.display()
exit_button.display() exit_button.display()
pygame.display.update() pygame.display.update()
@ -87,7 +95,9 @@ def starting_screen():
raise SystemExit raise SystemExit
if pygame.mouse.get_pressed()[0]: if pygame.mouse.get_pressed()[0]:
if play_button.check_click(pygame.mouse.get_pos()): if play_button.check_click(pygame.mouse.get_pos()):
return True return 1
if Oplay_button.check_click(pygame.mouse.get_pos()):
return 2
if exit_button.check_click(pygame.mouse.get_pos()): if exit_button.check_click(pygame.mouse.get_pos()):
return False return 0

Loading…
Cancel
Save