cjbell630 / Karel_the_Robot-Python

A port of Karel the Robot for Python
https://cjbell630.github.io/Karel_the_Robot-Python/
1 stars 1 forks source link

Why does world close at end of program? #4

Open MrMazzone opened 3 years ago

MrMazzone commented 3 years ago

Hi. Love that you added Karel to PyPi! Thank you for that.

Why does the world close when the Karel script is done?

When I removed the following lines from your package, the running a forever loop of wait() method will keep the window open.

print("[World] Saving screenshot...")
pygame.image.save(self.__screen, "final_world_status.jpg")
print("[World] Quitting...")
pygame.quit()

Maybe we can make a method that can be used at the end of a program to keep the window open until the X is clicked to close. I will look into that now.

MrMazzone commented 3 years ago

Okay. Sending commit now with a fix. Let me know what you think.