Separated some functinos into different "front end" and "back end" sides
This commit is contained in:
@ -26,7 +26,13 @@ class Game:
|
||||
|
||||
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
|
||||
@ -35,12 +41,24 @@ class Game:
|
||||
self.onEvent(timeout)
|
||||
self._timeouts.remove(timeout)
|
||||
|
||||
# Game update
|
||||
self.update()
|
||||
|
||||
# TODO: Draw things like debug menu, etc.
|
||||
|
||||
def onEvent(self, event):
|
||||
"""
|
||||
Intended to be overridden by the game developer.
|
||||
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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user