Trying to make a toggle type button in pygame. Having an issue
Alright, so the issue here is that upon reviving the click, the first
condition is satisfied, and the variable is set to true. Immediately
after, the event is like... still going on or whatever, and the variable
being false satisfies the second condition, which immediately resets the
variable to true. Any ideas on how to resolve this sort of thing?
for event in pygame.event.get():
if event.type == MOUSEBUTTONDOWN :
x, y = event.pos
if TutorialOn == True:
if x >= 25 and x <= 175 and y >= 350 and y<= 450:
TutorialOn = False
if TutorialOn == False:
if x >= 25 and x <= 175 and y >= 350 and y<= 450:
TutorialOn = True
No comments:
Post a Comment