I am writing a test game with PyGame and have a turn/phase based system (Like in Yu-Gi-Oh!) however the problem I am having is when I want to increase the Turn Counter (on the Draw Phases) it keeps incrementing it indefinitely until I press the mouse click again to release the mouse hold. Is there a way to break the incrementing and go straight to the next phase right after it increments once? I assume the problem has to do with the game loop itself refreshing so rapidly. Maybe I could freeze the game loop? Another alternative would be to automatically (not by mouse click) shift from turn to turn but I would still have to press a button to shift into the next phase. Any Ideas? Could I possibly increment this outside of the game loop?
#The Game Phases (outside of the game loop):
phases = "Coin Flip","Your Draw Phase", "Your Standby Phase", "Your Main Phase 1", "Your Battle Phase", "Your Main Phase 2", "Your End Phase", "Their Draw Phase", "Their Standby Phase", "Their Main Phase 1", "Their Battle Phase", "Their Main Phase 2", "Their End Phase" #enemy phases
#Code Inside the game loop:
#If phase = A Draw Phase then the Turn Counter increments.
if phasecounter == 1:
turncounter += 1
elif phasecounter == 7:
turncounter += 1
#A Mouse Click that can will change the Phase on the Screen (displayed by Text).
if event.type == pygame.MOUSEBUTTONDOWN:
phasecounter += 1
#Loops the Phases.
if phasecounter > 12:
phasecounter = 1
currentphase = phases[phasecounter]