[gnome-games] swell-foop: only score 1000 points when cleaning the board



commit 69fea9c89475253ec5e83cdf6e7623e7360cdc55
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Sun Mar 11 23:55:58 2012 +0100

    swell-foop: only score 1000 points when cleaning the board
    
    GNOME bug #671854

 swell-foop/src/game.vala |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/swell-foop/src/game.vala b/swell-foop/src/game.vala
index af2cd78..8650fe5 100644
--- a/swell-foop/src/game.vala
+++ b/swell-foop/src/game.vala
@@ -220,7 +220,7 @@ public class Game : Object
             for (int y = 0; y < rows; y++)
                 tiles[y, new_x] = null;
 
-        increment_score ((int)cl.length ());
+        increment_score_from_tiles ((int)cl.length ());
 
         if (this.has_completed ())
         {
@@ -263,23 +263,19 @@ public class Game : Object
         return true;
     }
 
-    public int calculate_score (int n_tiles)
+    public void increment_score_from_tiles (int n_tiles)
     {
         var points_awarded = 0;
 
         if (n_tiles >= 3)
             points_awarded = (n_tiles - 2) * (n_tiles - 2);
 
-        update_score (points_awarded);
-
-        return points_awarded;
+        increment_score (points_awarded);
     }
 
-    public void increment_score (int tiles)
+    public void increment_score (int increment)
     {
-        var points_awarded = calculate_score (tiles);
-        score += points_awarded;
-
-        update_score (points_awarded);
+        score += increment;
+        update_score (increment);
     }
 }



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