Created the main game loop and started writing the game's states.

This commit is contained in:
2013-01-07 20:22:23 -04:30
parent 5ba2ea4478
commit d24cd3861b
10 changed files with 380 additions and 0 deletions

19
state.py Normal file
View File

@@ -0,0 +1,19 @@
# Miguel Angel Astor Romero. Created on 7-1-2012. #
###################################################
# Valid game states.
VALID_STATES = { 'INTRO':0, 'MENU':1, 'IN_GAME':2, 'SCORE':3, 'STAY':4, 'QUIT':89}
# Parent class for game states.
class BaseState:
def input(self):
""" Empty. Should handle PyGame input. """
pass
def update(self):
""" Empty. Should update the state. Returns a state to transition to. """
return VALID_STATES['STAY']
def render(self, canvas):
""" Empty. Should render this state on the canvas. """
pass