Skip to content
Advertisement

Does running pygame usually make computers warm

When I run a simple pygame program using PyCharm on my M1 MacBook, I notice that my laptop gets kinda warm after running the program for 5-10 minutes. Is this normal, or does the while loop “tax” the computer. Thanks.

Code below:

JavaScript

Advertisement

Answer

limit the frames per second to limit CPU usage with pygame.time.Clock.tick The method tick() of a pygame.time.Clock object, delays the game in that way, that every iteration of the loop consumes the same period of time. See pygame.time.Clock.tick():

This method should be called once per frame.

That means that the following loop only runs 60 times per second.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement