[gnome-games/gnibbles-clutter-rebased: 86/129] Nicer animation when worm die



commit 141b3f9e1f9beb15be4a1987b13b9b8582d2ae97
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Thu Aug 6 16:51:02 2009 -0400

    Nicer animation when worm die

 gnibbles/worm-clutter.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/gnibbles/worm-clutter.c b/gnibbles/worm-clutter.c
index 56616e9..303870e 100644
--- a/gnibbles/worm-clutter.c
+++ b/gnibbles/worm-clutter.c
@@ -356,6 +356,7 @@ gnibbles_worm_reset (ClutterAnimation *animation, gpointer data)
     }
     board->walls[worm->xtail][worm->ytail] = EMPTYCHAR;
   }
+  /* DEBUG *//*
   gint i;
   FILE *fo;
   fo = fopen ("output.txt", "w" );
@@ -369,27 +370,23 @@ gnibbles_worm_reset (ClutterAnimation *animation, gpointer data)
     fprintf (fo, "\n");
   }
   fclose (fo);
+  */
 }
 
 static void *
 gnibbles_worm_animate_death (GnibblesWorm *worm)
 {
-  gint i;
-  ClutterActor *actor;
   ClutterAnimation *animation = NULL;
-  gfloat w,h;
-  gint count = clutter_group_get_n_children (CLUTTER_GROUP (worm->actors));
 
-  for (i = 0; i < count; i++) {
-    actor = clutter_group_get_nth_child (CLUTTER_GROUP (worm->actors), i);
-    clutter_actor_get_size (actor, &w, &h);
-
-    animation = clutter_actor_animate (actor, CLUTTER_EASE_OUT_QUAD, 210,
-                           "opacity", 0,
-                           "height", h * 1.7,
-                           "width", w * 1.7,
-                           NULL);
-  }
+  animation = clutter_actor_animate (worm->actors, CLUTTER_EASE_OUT_QUAD, 210,
+                                     "opacity", 0,
+                                     "scale-x", 2.0,
+                                     "scale-y", 2.0,
+                                     "fixed::scale-center-x", 
+                                     (gfloat) worm->xhead * properties->tilesize,
+                                     "fixed::scale-center-y",
+                                     (gfloat) worm->yhead * properties->tilesize,
+                                     NULL);
 
   return animation;
 }



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