[gnome-games/gnibbles-clutter] Nicer animation when worm die
- From: Guillaume Béland <guillaubel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games/gnibbles-clutter] Nicer animation when worm die
- Date: Thu, 6 Aug 2009 20:51:46 +0000 (UTC)
commit 40deb0948c13d355b1814065808c4e5e086ac086
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 7ee2406..3be85c8 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]