Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgame1/collectgame.py1
-rwxr-xr-xgame2/game2.py9
-rwxr-xr-xusmpgames/applicationstate.py4
3 files changed, 10 insertions, 4 deletions
diff --git a/game1/collectgame.py b/game1/collectgame.py
index 77e86b8..76cdaff 100755
--- a/game1/collectgame.py
+++ b/game1/collectgame.py
@@ -34,6 +34,7 @@ class CollectGame(usmpgames.ApplicationState):
color = (0, 255, 0, 0),
pos = (660, 260),
rectsize = (380, 390));
+ usmpgames.ApplicationState.exiting_state(self, fromStack)
def input(self, ms):
events = pygame.event.get()
diff --git a/game2/game2.py b/game2/game2.py
index 180df8f..e575b5e 100755
--- a/game2/game2.py
+++ b/game2/game2.py
@@ -142,8 +142,9 @@ class Game2(usmpgames.ApplicationState):
#Get initial time
global TIMESTART
TIMESTART= round(time.time(),0)
- global score
+ global score, a
score = 0
+ a = 0
def exiting_state(self, fromStack):
global score
@@ -153,6 +154,9 @@ class Game2(usmpgames.ApplicationState):
color = (0, 255, 0, 0),
pos = (660, 260),
rectsize = (380, 390) );
+ global musicSound
+ musicSound.stop()
+ usmpgames.ApplicationState.exiting_state(self, fromStack)
def loop(self, ms):
global gameOverSound, correctAnswerSound, musicSound
@@ -447,7 +451,8 @@ def compareTime(playTime, gamestate):
#print('c time: '+str(c))
if(c>TIMELIMIT):
#print ('Time Limit!')
- gamestate.set_running( False )
+ #gamestate.set_running( False )
+ gamestate.go_to_next_state()
#Loading Image Method
def load_image(fileName):
diff --git a/usmpgames/applicationstate.py b/usmpgames/applicationstate.py
index de4fc6c..6f6439b 100755
--- a/usmpgames/applicationstate.py
+++ b/usmpgames/applicationstate.py
@@ -57,11 +57,11 @@ class ApplicationState():
self.post_render(ms)
def entering_state(self, fromStack):
- #print "Entering state ", self
+ print "Entering state ", self
self.set_running(True)
def exiting_state(self, toStack):
- #print "Exiting state ", self
+ print "Exiting state ", self
pass
def go_to_next_state(self):