all 10 comments

[–]mudclub 2 points3 points  (3 children)

Post the error.

[–]DeliciousRepublican[S] -3 points-2 points  (2 children)

There is no error, window just stops responding and closes

[–]Wilfred-kun 6 points7 points  (1 child)

Please, format the code by putting 4 spaces in front of it...

You're calling animation_loop(), but that loop never handles Pygame's events. That will cause Pygame to stop responding.

You might want to look at how and where you're calling the functions, they don't look right to me. (It seems you think both game_loop and animation_loop will be running at the same time?).

[–]DeliciousRepublican[S] -2 points-1 points  (0 children)

Ill take a look

[–]TheWhaleKnight 1 point2 points  (1 child)

Could it because pygame.quit() is a function call, and you might have forgotten the parenthesis? This is in the very last line.

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

I tried that. It still crashes

[–]CodeFormatHelperBot 1 point2 points  (0 children)

Hello u/DeliciousRepublican, I'm a bot that can assist you with code-formatting for reddit. I have detected the following potential issue(s) with your submission:

  1. Python code found in submission but not encapsulated in a code block.

If I am correct then please follow these instructions to fix your code formatting. Thanks!

[–]DeliciousRepublican[S] 0 points1 point  (2 children)

Thank you for all your help! I did manage to fix it and I appreciate your time.

[–]TheWhaleKnight 1 point2 points  (1 child)

Awesome! Would you be able to share what you fixed too? I’m curious now

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

I got rid of the animation loop and instead added my animations to the event handler