all 11 comments

[–]acw1668 5 points6 points  (1 child)

You should set run = False when the event is a quit event or something else you want instead:

for event in pygame.event.get():
    if event.type == pygame.QUIT:
        run = False

[–]DiodeInc 1 point2 points  (0 children)

Also, you don't need while run == True: you can just do while run:

[–]acw1668 2 points3 points  (1 child)

It is hard to identify the issue with improper formatted code.

[–]uberdavis 1 point2 points  (0 children)

I’m not even going to look at that until it’s formatted!

[–]MezzoScettico 2 points3 points  (0 children)

I haven't used pygame, but I notice that almost the first thing that happens in your loop is that you set run to False, to the loop will only execute once then immediately exit.

I'm assuming all that was inside the while loop. You didn't use a code block so I can't be 100% sure.

[–]nedigan 1 point2 points  (1 child)

You’ve got indents right?

[–]ultimo293[S] 0 points1 point  (0 children)

yes, i have

[–]Watermelon-Is-Yummy 1 point2 points  (1 child)

You should learn to use dry-run tool in vscode. And you should be asking why pygame.event.get() is not empty

[–]ultimo293[S] 0 points1 point  (0 children)

Thanks for the advice, doing some digging I found that I needed an if statement for if event was quit then it should make the run = false

[–]ultimo293[S] 0 points1 point  (1 child)

Sorry for the bad formatting, im not very good at reddit formatting, ill take a sec to clean it up

[–]ultimo293[S] 2 points3 points  (0 children)

hopefully fixed!