[gnome-games/gnibbles-clutter-rebased: 50/129] Added fade-in animation on level & worm on game start



commit 2f0a1d9ba712225dddee0637e944d6c4fa2f0ec8
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Wed Jul 15 16:53:02 2009 -0400

    Added fade-in animation on level & worm on game start

 gnibbles/board.c        |    6 ++++++
 gnibbles/gnibbles.c     |    4 ++--
 gnibbles/worm-clutter.c |    5 +++++
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gnibbles/board.c b/gnibbles/board.c
index 36c3438..3b8025d 100644
--- a/gnibbles/board.c
+++ b/gnibbles/board.c
@@ -170,6 +170,12 @@ gnibbles_board_load_level (GnibblesBoard *board, GnibblesLevel *level)
   ClutterActor *stage = gnibbles_board_get_stage (board);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), board->level);
   clutter_actor_raise (board->level,board->surface);
+
+  clutter_actor_set_opacity (board->level, 0);
+  clutter_actor_animate (board->level, CLUTTER_EASE_IN_QUAD, 410,
+                         "opacity", 255,
+                         NULL);
+
 }
 
 void
diff --git a/gnibbles/gnibbles.c b/gnibbles/gnibbles.c
index 7c325c6..cf57c13 100644
--- a/gnibbles/gnibbles.c
+++ b/gnibbles/gnibbles.c
@@ -267,13 +267,13 @@ gnibbles_move_worms (void)
     if (worms[i]->xhead >= BOARDWIDTH) {
       worms[i]->xhead = 0;
       gnibbles_worm_add_actor(worms[i]);
-    } else if (worms[i]->xhead < 0) {
+    } else if (worms[i]->xhead <= 0) {
       worms[i]->xhead = BOARDWIDTH;
       gnibbles_worm_add_actor (worms[i]);
     } else if (worms[i]->yhead >= BOARDHEIGHT) {
       worms[i]->yhead = 0;
       gnibbles_worm_add_actor (worms[i]);
-    } else if (worms[i]->xhead < 0) {
+    } else if (worms[i]->xhead <= 0) {
       worms[i]->yhead = BOARDHEIGHT;
       gnibbles_worm_add_actor (worms[i]);
     }
diff --git a/gnibbles/worm-clutter.c b/gnibbles/worm-clutter.c
index c8c3b2f..a04388e 100644
--- a/gnibbles/worm-clutter.c
+++ b/gnibbles/worm-clutter.c
@@ -343,6 +343,11 @@ gnibbles_worm_new (guint number, guint t_xhead,
   gnibbles_worm_add_actor (worm);
   gnibbles_worm_queue_empty (worm);
 
+  clutter_actor_set_opacity (worm->actors, 0);
+  clutter_actor_animate (worm->actors, CLUTTER_EASE_IN_QUAD, 410,
+                         "opacity", 0xff,
+                         NULL);
+
   return worm;
 }
 



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