diff --git a/constants.py b/constants.py new file mode 100644 index 0000000..ad1b548 --- /dev/null +++ b/constants.py @@ -0,0 +1,2 @@ +# Debug constant. Set to False to turn off debugging messages. +DEBUG = False diff --git a/game.py b/game.py index 74df4c0..e2128c1 100644 --- a/game.py +++ b/game.py @@ -13,9 +13,7 @@ from menu import MenuState from ingame import InGameState from score import ScoreState from notvalidstate import NotValidState - -# Debug constant. Set to False to turn off debugging messages. -DEBUG = False +from constants import DEBUG # The Game class implements the state machine of the game and # runs the main game loop. diff --git a/intro.py b/intro.py index fa0c002..4ea2824 100644 --- a/intro.py +++ b/intro.py @@ -14,6 +14,7 @@ from state import BaseState, VALID_STATES import actor import game import particle +from constants import DEBUG class IntroState(BaseState): def __init__(self): diff --git a/notvalidstate.py b/notvalidstate.py deleted file mode 100644 index ea9ef74..0000000 --- a/notvalidstate.py +++ /dev/null @@ -1,37 +0,0 @@ -# Miguel Angel Astor Romero. Created on 7-1-2013. # -################################################### -import pygame - -try: - import android -except ImportError: - android = None - -from state import BaseState, VALID_STATES - -class NotValidState(BaseState): - def __init__(self): - BaseState.__init__(self) - - self.count = 0 - 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'] - - def input(self): - for event in pygame.event.get(): - if android: - if android.check_pause(): - android.wait_for_resume() - - if event.type == pygame.KEYDOWN: - self.next_transition = VALID_STATES['QUIT'] - if event.type == pygame.QUIT: - self.next_transition = VALID_STATES['QUIT'] - - def update(self): - return self.next_transition - - def render(self, canvas): - canvas.fill(self.background_color) - pygame.draw.rect(canvas, (0, 0, 0), self.rectangle)