Separated some functinos into different "front end" and "back end" sides

This commit is contained in:
2025-06-24 06:06:21 +01:00
parent 9d6f775ab9
commit 8893fd90c6

View File

@ -26,7 +26,13 @@ class Game:
def update(self): def update(self):
""" """
Updates some core things in the background. Intended to be overridden by the game developer.
See BaseGame for documentation.
"""
def _update(self):
"""
Updates some core things in the background, and calls update()
""" """
# Handle timeouts # Handle timeouts
@ -35,12 +41,24 @@ class Game:
self.onEvent(timeout) self.onEvent(timeout)
self._timeouts.remove(timeout) self._timeouts.remove(timeout)
# Game update
self.update()
# TODO: Draw things like debug menu, etc.
def onEvent(self, event): def onEvent(self, event):
""" """
Intended to be overridden by the game developer. Intended to be overridden by the game developer.
See BaseGame for documentation. See BaseGame for documentation.
""" """
def _onEvent(self, event):
"""
Updates some core things in the background, and calls onEvent()
"""
if not self._haltEvents:
self.onEvent(event)
def close(self): def close(self):
""" """