Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created June 12, 2021 10:20
Show Gist options
  • Save PatrickKalkman/607fb0a2e45082801a98704b7e9d83b8 to your computer and use it in GitHub Desktop.
Save PatrickKalkman/607fb0a2e45082801a98704b7e9d83b8 to your computer and use it in GitHub Desktop.
Base class for each state of the state machine
class BaseState(object):
def __init__(self):
self.done = False
self.quit = False
self.next_state = None
self.screen_rect = pygame.display.get_surface().get_rect()
self.font = pygame.font.Font(None, 32)
def startup(self):
pass
def get_event(self, event):
pass
def update(self, dt):
pass
def draw(self, surface):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment