I'm trying to add a basic feature in my game where if I press the pause button, it stops updating other game elements such as the player and obstacles and buttons such as resume, restart and main menu appear on your screen. I was able to make it work, but my problem now is that when I press any of the three buttons, they do not execute the code under them. Any form of help would be appreciated.
Python:
# Start
if game_started == True:
game_over = False
t = pygame.time.get_ticks()
clock.tick(fps)
# Display instances
screen.blit(bg, (0, 0))
kivotos.draw()
player.update()
obstacle.update()
draw_grid()
if pause_btn.draw() == True:
if resume_btn.draw() == True:
print("resume")
if restart_btn.draw() == True:
print("restart")
if main_menu_btn.draw() == True:
print("main menu")
game_started = not game_started