When i click on the exit button or just left click i often need to click more than once before it registers my input and does what i want it to do in pygame. I have no idea what is causing this to happen.
Here is my game-loop:
while running:
window.fill(light_black)
for event in pygame.event.get():
print(event) # Debug
if event.type == pygame.MOUSEBUTTONUP:
mpos_x, mpos_y = pygame.mouse.get_pos()
boids.append(CreateBoid(mpos_x, mpos_y))
for boid in boids:
boid.draw()
pygame.display.update()
if check_exit():
running = False
I'm using the PyCharm IDE if that could have anything to do with it.
Thanks
EDIT: It was solved by removing the check_exit() function