Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game2
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 /game2
parent9069351549ac97cebc4816030de42759d6466c25 (diff)
Implemented cookie system to avoid creation of many objects
Diffstat (limited to 'game2')
-rwxr-xr-xgame2/game2.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/game2/game2.py b/game2/game2.py
index 30a9a54..8294c7e 100755
--- a/game2/game2.py
+++ b/game2/game2.py
@@ -103,8 +103,8 @@ n = 0
class Game2(usmpgames.ApplicationState):
- def __init__(self, game_mode, next_state = None, background_image = None):
- usmpgames.ApplicationState.__init__(self, next_state, background_image)
+ def __init__(self, game_mode, next_state = None, background_image = None, next_cookie = None):
+ usmpgames.ApplicationState.__init__(self, next_state, background_image, next_cookie)
self.game_mode = game_mode
global gameOverSound, correctAnswerSound, musicSound
@@ -130,12 +130,12 @@ class Game2(usmpgames.ApplicationState):
self.new_operation = True
- def entering_state(self, fromStack):
- usmpgames.ApplicationState.entering_state(self, fromStack)
+ def entering_state(self, fromStack, cookie):
+ usmpgames.ApplicationState.entering_state(self, fromStack, cookie)
global n
global GAMEMODE
n = 0
- GAMEMODE = self.game_mode
+ GAMEMODE = cookie
#Get initial time
global TIMESTART
TIMESTART= round(time.time(),0)