From 62eae792b0b392cf111dc95aab3ee520ca9c58f1 Mon Sep 17 00:00:00 2001 From: Mateu Batle Date: Tue, 23 Nov 2010 15:33:31 +0000 Subject: Implemented cookie system to avoid creation of many objects --- (limited to 'game1') diff --git a/game1/collectgame.py b/game1/collectgame.py index 50ba314..04748ce 100755 --- a/game1/collectgame.py +++ b/game1/collectgame.py @@ -11,13 +11,14 @@ from gettext import gettext as _ class CollectGame(usmpgames.ApplicationState): - def __init__(self, game_mode, next_state = None, background = None): - usmpgames.ApplicationState.__init__(self, next_state, background) + def __init__(self, game_mode, next_state = None, background = None, next_cookie = None): + usmpgames.ApplicationState.__init__(self, next_state, background, next_cookie) self.game_mode = game_mode self.font = pygame.font.SysFont(None, 80) - def entering_state(self, fromStack): - usmpgames.ApplicationState.entering_state(self, fromStack) + def entering_state(self, fromStack, cookie): + usmpgames.ApplicationState.entering_state(self, fromStack, cookie) + self.game_mode = cookie if (not fromStack) : self.track = Track() self.player = Player(self.game_mode) -- cgit v0.9.1