[gnome-nibbles/wip/vala] Remove old actors when starting a new game



commit 3247d06de4b57f248bd80b5b9bbec7a2f1855531
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Tue Aug 11 12:57:09 2015 +0300

    Remove old actors when starting a new game

 src/nibbles-view.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/nibbles-view.vala b/src/nibbles-view.vala
index f3f34dc..5e28c8c 100644
--- a/src/nibbles-view.vala
+++ b/src/nibbles-view.vala
@@ -101,12 +101,14 @@ public class NibblesView : GtkClutter.Embed
         }
 
 
-        // foreach (var actor in worm_actors.values)
-        // {
-        //     actor.destroy ();
-        // }
+        foreach (var actor in worm_actors.values)
+            actor.destroy ();
         worm_actors.clear ();
+
+        foreach (var actor in bonus_actors.values)
+            actor.destroy ();
         bonus_actors.clear ();
+
         game.boni.reset (game.numworms);
 
         for (int i = 0; i < NibblesGame.HEIGHT; i++)


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