Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game1
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2010-11-23 15:33:31 (GMT)
committer Mateu Batle <mateu.batle@collabora.co.uk>2010-11-23 15:33:31 (GMT)
commit62eae792b0b392cf111dc95aab3ee520ca9c58f1 (patch)
treefa127cb3032c67057cd115743142c60b595f0e4e /game1
parent9069351549ac97cebc4816030de42759d6466c25 (diff)
Implemented cookie system to avoid creation of many objects
Diffstat (limited to 'game1')
-rwxr-xr-xgame1/collectgame.py9
1 files changed, 5 insertions, 4 deletions
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)