if ended == True and didDrawBack == False: didDrawBack = True returnButton.draw() someLabel.draw() ev = pygame.event.poll() if ev.type == pygame.QUIT: sys.exit() if ev.type == pygame.MOUSEBUTTONDOWN and ended == False: x, y = ev.pos for button in buttons: if button.checkIfPosIsInRec(x,y): button.action() if ev.type == pygame.MOUSEBUTTONDOWN and ended == True: x, y = ev.pos if returnButton.checkIfPosIsInRec(x,y): returnButton.action() if number <= 1: counterLabel.updateText(str(number) + " Oompa Loompa- BUY OMAR!") else: counterLabel.updateText(str(number) + " Oompa Loompas") thingsBoughtLabel.clear() thingsBoughtLabel.updateText("$"+str(price)) pygame.display.flip()