Centered the "camera" on the player.

This commit is contained in:
2013-01-19 10:07:01 -04:30
parent e6cc4955e3
commit 4ff6171533
2 changed files with 49 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ VALID_STATES = { 'INTRO':0, 'MENU':1, 'IN_GAME':2, 'SCORE':3, 'STAY':4, 'QUIT':8
class BaseState:
def __init__(self):
self.background_color = (139, 210, 228)
self.screen_center = (pygame.display.Info().current_w / 2, pygame.display.Info().current_h / 2)
def input(self):
""" Empty. Should handle PyGame input. """
@@ -23,5 +24,4 @@ class BaseState:
canvas.fill(self.background_color)
def get_screen_center(self):
return (pygame.display.Info().current_w / 2,
pygame.display.Info().current_h / 2)
return self.screen_center