from naja.sound import sound
from naja.options import parse_args
from naja.scenes.menu import MenuScene
+from naja.gamestate import GameState
def main():
sound.init()
screen = pygame.display.get_surface()
+ state = GameState()
scene = MenuScene()
- engine = Engine(screen, scene)
+ engine = Engine(screen, scene, state)
engine.run()
class Engine(object):
- def __init__(self, surface, scene):
+ def __init__(self, surface, scene, state):
self._surface = surface
self._scene = scene
+ self._state = state
def run(self):
clock = pygame.time.Clock()
--- /dev/null
+"""
+The current game state.
+"""
+
+from .constants import NORTH, SOUTH, EAST, WEST
+from .gameboard import GameBoard
+from .player import Player
+
+
+class GameState(object):
+ """
+ Naja game state.
+ """
+
+ INITIAL_BITS = NORTH | SOUTH | EAST | WEST
+ MAX_HEALTH = 4
+ WINS_REQUIRED = 4
+
+ def __init__(self):
+ self.player = Player(self.INITIAL_BITS, (0, 0))
+ self.gameboard = GameBoard(
+ self.player, self.MAX_HEALTH, self.WINS_REQUIRED)