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 'game2') 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) -- cgit v0.9.1