Tested the get_screen_center function.
This commit is contained in:
@@ -12,7 +12,8 @@ from state import BaseState, VALID_STATES
|
|||||||
class InGameState(BaseState):
|
class InGameState(BaseState):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.rectangle = pygame.Rect(250, 350, 100, 100)
|
screen_center = self.get_screen_center()
|
||||||
|
self.rectangle = pygame.Rect(screen_center[0] - 50, screen_center[1] - 50, 100, 100)
|
||||||
self.next_transition = VALID_STATES['STAY']
|
self.next_transition = VALID_STATES['STAY']
|
||||||
|
|
||||||
def input(self):
|
def input(self):
|
||||||
|
3
intro.py
3
intro.py
@@ -12,7 +12,8 @@ from state import BaseState, VALID_STATES
|
|||||||
class IntroState(BaseState):
|
class IntroState(BaseState):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.rectangle = pygame.Rect(250, 350, 100, 100)
|
screen_center = self.get_screen_center()
|
||||||
|
self.rectangle = pygame.Rect(screen_center[0] - 50, screen_center[1] - 50, 100, 100)
|
||||||
self.next_transition = VALID_STATES['STAY']
|
self.next_transition = VALID_STATES['STAY']
|
||||||
|
|
||||||
def input(self):
|
def input(self):
|
||||||
|
3
menu.py
3
menu.py
@@ -12,7 +12,8 @@ from state import BaseState, VALID_STATES
|
|||||||
class MenuState(BaseState):
|
class MenuState(BaseState):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.rectangle = pygame.Rect(250, 350, 100, 100)
|
screen_center = self.get_screen_center()
|
||||||
|
self.rectangle = pygame.Rect(screen_center[0] - 50, screen_center[1] - 50, 100, 100)
|
||||||
self.next_transition = VALID_STATES['STAY']
|
self.next_transition = VALID_STATES['STAY']
|
||||||
|
|
||||||
def input(self):
|
def input(self):
|
||||||
|
@@ -12,7 +12,8 @@ from state import BaseState, VALID_STATES
|
|||||||
class NotValidState(BaseState):
|
class NotValidState(BaseState):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.rectangle = pygame.Rect(250, 350, 100, 100)
|
screen_center = self.get_screen_center()
|
||||||
|
self.rectangle = pygame.Rect(screen_center[0] - 50, screen_center[1] - 50, 100, 100)
|
||||||
self.next_transition = VALID_STATES['STAY']
|
self.next_transition = VALID_STATES['STAY']
|
||||||
|
|
||||||
def input(self):
|
def input(self):
|
||||||
|
3
score.py
3
score.py
@@ -12,7 +12,8 @@ from state import BaseState, VALID_STATES
|
|||||||
class ScoreState(BaseState):
|
class ScoreState(BaseState):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.rectangle = pygame.Rect(250, 350, 100, 100)
|
screen_center = self.get_screen_center()
|
||||||
|
self.rectangle = pygame.Rect(screen_center[0] - 50, screen_center[1] - 50, 100, 100)
|
||||||
self.next_transition = VALID_STATES['STAY']
|
self.next_transition = VALID_STATES['STAY']
|
||||||
|
|
||||||
def input(self):
|
def input(self):
|
||||||
|
Reference in New Issue
Block a user