0

I am creating a simulation using pygame and have noticed that pygame makes it a little complicated to have text on the window while the application is running. Right now, my program shows a ball moving around the screen and creates a trail of colors identifying how many times it has passed over that area. What I need to happen, and what the text will be used for, is to display the day and temperature above the grid the ball moves around. Every 20 directiontional changes equals a day and each day has a temperature associated with it, so as the program runs, the text has to change respective to the current day and temperature.

My question is: Are there any good modules that I could import which could do this efficiently, as I only want to use pygame for rendering my simulation in a not so computationally expensive way?

  • 1
    Can you explain more specifically what you mean by "makes it a little complicated"? Maybe show the code you have tried so far and why it is not achieving the result you want. – Bill Mar 30 '20 at 22:51
  • I havent used it in my program yet but I've used it in the past. while looking at my code now, needing to create a new surface that would constantly be updated and rewritten every 20 directional changes (or every 30 seconds) seems too computationally expensive; especially when in my current code, it takes from a large list of days and temperatures (a years worth). Pygame needs a new surface, text variable, rect object, and then would copy the text onto the new surface. As mentioned before, this would be done every 30 seconds and to me, seems excessive. – WebDevStudent Mar 31 '20 at 00:01
  • Maybe it is my future code with pygame, maybe it's my end goal. In order to achieve what's needed, my output has to be one that would constantly update and continue for a simulated year. 365 days with its respective temperature showing on the screen as the program runs. – WebDevStudent Mar 31 '20 at 00:02
  • If you haven't tested it with the basic pygame functions how can you be sure it is too computationally expensive? You can also try [pyglet](http://pyglet.org) – Bill Mar 31 '20 at 05:01

0 Answers0