Moved background color to BaseState.
This commit is contained in:
5
state.py
5
state.py
@@ -7,6 +7,9 @@ VALID_STATES = { 'INTRO':0, 'MENU':1, 'IN_GAME':2, 'SCORE':3, 'STAY':4, 'QUIT':8
|
||||
|
||||
# Parent class for game states.
|
||||
class BaseState:
|
||||
def __init__(self):
|
||||
self.background_color = (139, 210, 228)
|
||||
|
||||
def input(self):
|
||||
""" Empty. Should handle PyGame input. """
|
||||
pass
|
||||
@@ -17,7 +20,7 @@ class BaseState:
|
||||
|
||||
def render(self, canvas):
|
||||
""" Empty. Should render this state on the canvas. """
|
||||
pass
|
||||
canvas.fill(self.background_color)
|
||||
|
||||
def get_screen_center(self):
|
||||
return (pygame.display.Info().current_w / 2,
|
||||
|
Reference in New Issue
Block a user