Troubleshooting - skytreader/PyGame-Objects GitHub Wiki
My game display is flickering.
Check your GameScreen draw_screen
and draw_unchanging
methods that they are not calling pygame.display.flip()
or pygame.display.update()
. Note that in any of your drawing code, you are not supposed to call pygame.display.flip()
or pygame.display.update()
.
Some components of my game is not rendering.
Make sure that all rendering in your game happens within your GameScreen's draw_screen
and draw_unchanging
methods and nowhere else.
My game is not rendering. At all.
Make sure that you instantiated the super class of all the framework components. Specifically, GameLoopEvents
must be instantiated (via super calls) and that its loop_events
method must be called. However, as it stands, there should be no reason to override loop_events
.
I get a window but the components are not rendering.
Check that the config passed to your game does not declare a window size of (0, 0) (note that this defaults to (0, 0) in case no value is supplied). See also https://github.com/skytreader/PyGame-Objects/issues/32.
CommonUI
components are not responding to events they should be listening to
My Make sure to add your components to the ui_elements
set of GameScreen
after creating them. That is, self.ui_elements.add(CommonUIComponent)
in the setup
method.
Using debug mode
To use debug mode, use a GameConfig
with the debug_mode
config val set to True
. To display the debug logs within the game, use self.debug_queue.log
in your GameLoopEvents
class.
You can specify the log level via a second parameter level
. This works in the same way as in Python's native logging
library.