[gnome-games/gnibbles-clutter-rebased: 108/129] New animation for on walls and finally reintroduced mariobros-like animation on
- From: Jason Clinton <jclinton src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games/gnibbles-clutter-rebased: 108/129] New animation for on walls and finally reintroduced mariobros-like animation on
- Date: Mon, 12 Oct 2009 21:35:18 +0000 (UTC)
commit eaba6dc28d7c174f2223e230878a1879912f8278
Author: Guillaume Beland <guillaume beland gmail com>
Date: Wed Aug 19 17:15:22 2009 -0400
New animation for on walls and finally reintroduced mariobros-like animation on
bonushalf
gnibbles/board.c | 6 +++---
gnibbles/worm.c | 23 ++++++++++++++++++++---
2 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/gnibbles/board.c b/gnibbles/board.c
index 5762120..c9560a8 100644
--- a/gnibbles/board.c
+++ b/gnibbles/board.c
@@ -66,7 +66,7 @@ gnibbles_board_new (void)
board->surface = clutter_texture_new_from_file (filename, NULL);
- clutter_actor_set_opacity (CLUTTER_ACTOR (board->surface), 80);
+ clutter_actor_set_opacity (CLUTTER_ACTOR (board->surface), 100);
g_value_init (&val, G_TYPE_BOOLEAN);
g_value_set_boolean ( &val, TRUE);
@@ -165,8 +165,8 @@ gnibbles_board_load_level (GnibblesBoard *board)
clutter_actor_raise (board->level, board->surface);
clutter_actor_set_opacity (board->level, 0);
- clutter_actor_set_scale (CLUTTER_ACTOR (board->level), 2.0, 2.0);
- clutter_actor_animate (board->level, CLUTTER_EASE_OUT_CIRC, 510,
+ clutter_actor_set_scale (CLUTTER_ACTOR (board->level), 0.2, 0.2);
+ clutter_actor_animate (board->level, CLUTTER_EASE_OUT_BOUNCE, 1210,
"opacity", 0xff,
"fixed::scale-gravity", CLUTTER_GRAVITY_CENTER,
"scale-x", 1.0,
diff --git a/gnibbles/worm.c b/gnibbles/worm.c
index f13a7a2..a0f1afe 100644
--- a/gnibbles/worm.c
+++ b/gnibbles/worm.c
@@ -581,7 +581,7 @@ gnibbles_worm_reset (GnibblesWorm *worm)
*/
//if (worm->lives > 0)
//gnibbles_worm_show (worm);
- gnibbles_worm_move_head_pointer (worm);
+ //gnibbles_worm_move_head_pointer (worm);
worm->stop = FALSE;
}
@@ -689,7 +689,7 @@ gnibbles_cworm_move (ClutterTimeline *timeline, gint frame_num, gpointer data)
void
gnibbles_worm_move_head (GnibblesWorm *worm)
{
- if (g_list_length (worm->list) <= 1)
+ if (g_list_length (worm->list) < 0)
return;
if (worm->human)
@@ -720,6 +720,9 @@ void
gnibbles_worm_reduce_tail (GnibblesWorm *worm, gint erasesize)
{
gint i;
+ gfloat x,y;
+ ClutterActor *tmp = NULL;
+ ClutterActor *group = clutter_group_new ();
if (erasesize) {
if (g_list_length (worm->list) <= erasesize) {
@@ -728,9 +731,23 @@ gnibbles_worm_reduce_tail (GnibblesWorm *worm, gint erasesize)
}
for (i = 0; i < erasesize; i++) {
+ tmp = gtk_clutter_texture_new_from_pixbuf (worm_pixmaps[worm->number]);
+ clutter_actor_get_position
+ (CLUTTER_ACTOR (g_list_last (worm->list)->data), &x, &y);
+ clutter_actor_set_position (CLUTTER_ACTOR (tmp), x, y);
+ clutter_actor_set_size (CLUTTER_ACTOR (tmp),
+ properties->tilesize,
+ properties->tilesize);
+ clutter_container_add_actor (CLUTTER_CONTAINER (group), tmp);
+
gnibbles_worm_move_tail_pointer (worm);
- worm->length--;
}
+ worm->length -= erasesize;
+ clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);
+
+ clutter_actor_animate (group, CLUTTER_EASE_OUT_ELASTIC, 450,
+ "opacity", 0,
+ NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]