[gcompris] algorithm, when help was called the level was increased.



commit ba712e3a304f41800e97657c977dc725316f64a1
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Mon Sep 24 23:20:06 2012 +0200

    algorithm, when help was called the level was increased.
    
    Fixed the pause() function to no more advance the level when
    the help menu is called.

 src/algorithm-activity/algorithm.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/algorithm-activity/algorithm.py b/src/algorithm-activity/algorithm.py
index 69fbcfc..32914bb 100644
--- a/src/algorithm-activity/algorithm.py
+++ b/src/algorithm-activity/algorithm.py
@@ -57,8 +57,7 @@ class Gcompris_algorithm:
 
     # These are used to let us restart only after the bonus is displayed.
     # When the bonus is displayed, it call us first with pause(1) and then with pause(0)
-    self.board_paused  = 0;
-    self.gamewon       = 0;
+    self.gamewon = False;
 
   def start(self):
     gcompris.bar_set (0)
@@ -100,9 +99,9 @@ class Gcompris_algorithm:
 
     # When the bonus is displayed, it call us first with pause(1) and then with pause(0)
     # the game is won
-    if(pause == 0):
+    if(pause == 0 and self.gamewon):
       self.increment_level()
-      self.gamewon = 0
+      self.gamewon = False
 
     return
 
@@ -205,6 +204,7 @@ class Gcompris_algorithm:
       self.paint_image(index, self.place, 147)
       self.place +=1
       if self.place == self.anzahl:
+        self.gamewon = True
         gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.TUX)
         return
       self.paint_qm ()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]