I'd like to I using the button Yes! could begin game again not quit from program and come in regularly. How to create it?
def game_over():
Game_over = True
while Game_over:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
#[...]
button.draw(450, 500, 'Yes!')
button.draw(720, 500, 'No!', beginning)
pygame.display.update()
clock.tick(FPS)
def game():
global health
Game = True
while Game:
clock.tick(FPS)
for event in pygame.event.get():
#[...]
if event.type == pygame.QUIT:
beginning = False
if health <= 0:
game_over()
#[...]
show_health()
button.draw(20, 80, 'Pause', pause)
pygame.display.update()
all_sprites.update()
def beginning():
Beginning = True
while Beginning:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
#[...]
mini_button = Button2(180, 120)
mini_button.draw(570, 200, 'PLAY', game)
mini_button.draw(570, 420, 'QUIT', QUIT)
pygame.display.update()
beginning()
pygame.quit()