[gnome-nibbles] view: do a bit of cleanup



commit 052bb2ef17ffbce6f397943e229367919196b708
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Wed Aug 19 23:39:59 2015 +0300

    view: do a bit of cleanup

 src/gnome-nibbles.vala |    6 ------
 src/nibbles-view.vala  |   21 ++++++---------------
 2 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index 37c848f..578a4af 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -293,12 +293,6 @@ public class Nibbles : Gtk.Application
             scoreboard.register (worm, NibblesView.colorval_name (color), scoreboard_life);
             worm.notify["lives"].connect (scoreboard.update);
             worm.notify["score"].connect (scoreboard.update);
-
-            var actors = view.worm_actors.get (worm);
-            if (actors.get_stage () == null)
-                view.stage.add_child (actors);
-
-            actors.show ();
         }
         game.add_worms ();
 
diff --git a/src/nibbles-view.vala b/src/nibbles-view.vala
index 6e13f2b..973424f 100644
--- a/src/nibbles-view.vala
+++ b/src/nibbles-view.vala
@@ -105,7 +105,6 @@ public class NibblesView : GtkClutter.Embed
             error (_("Nibbles couldn't find pixmap file: %s"), filename);
         }
 
-
         foreach (var actor in worm_actors.values)
             actor.destroy ();
         worm_actors.clear ();
@@ -119,6 +118,7 @@ public class NibblesView : GtkClutter.Embed
         warp_actors.clear ();
 
         game.boni.reset (game.numworms);
+        game.warp_manager.warps.clear ();
 
         for (int i = 0; i < NibblesGame.HEIGHT; i++)
         {
@@ -140,6 +140,7 @@ public class NibblesView : GtkClutter.Embed
                             game.worms[count].set_start (j, i, WormDirection.UP);
 
                             var actors = new WormActor ();
+                            stage.add_child (actors);
                             worm_actors.set (game.worms[count], actors);
                             count++;
                         }
@@ -151,6 +152,7 @@ public class NibblesView : GtkClutter.Embed
                             game.worms[count].set_start (j, i, WormDirection.LEFT);
 
                             var actors = new WormActor ();
+                            stage.add_child (actors);
                             worm_actors.set (game.worms[count], actors);
                             count++;
                         }
@@ -162,6 +164,7 @@ public class NibblesView : GtkClutter.Embed
                             game.worms[count].set_start (j, i, WormDirection.DOWN);
 
                             var actors = new WormActor ();
+                            stage.add_child (actors);
                             worm_actors.set (game.worms[count], actors);
                             count++;
                         }
@@ -173,6 +176,7 @@ public class NibblesView : GtkClutter.Embed
                             game.worms[count].set_start (j, i, WormDirection.RIGHT);
 
                             var actors = new WormActor ();
+                            stage.add_child (actors);
                             worm_actors.set (game.worms[count], actors);
                             count++;
                         }
@@ -492,19 +496,6 @@ public class NibblesView : GtkClutter.Embed
             actors.restore_easing_state ();
         }
 
-        foreach (var bonus in game.boni.bonuses)
-        {
-            var actor = bonus_actors.get (bonus);
-
-            actor.save_easing_state ();
-            actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
-            actor.set_easing_duration (NibblesGame.GAMEDELAY * 15);
-            actor.set_scale (0.4f, 0.4f);
-            actor.set_pivot_point (0.5f, 0.5f);
-            actor.set_opacity (0);
-            actor.restore_easing_state ();
-        }
-
         foreach (var warp in game.warp_manager.warps)
         {
             var actor = warp_actors.get (warp);
@@ -916,7 +907,7 @@ public class WarpTexture: GtkClutter.Texture
         base.show ();
 
         set_opacity (0);
-        set_scale (2.0, 2.0);
+        set_scale (3.0, 3.0);
 
         save_easing_state ();
         set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);


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