[gnome-games] Disabled logo, fixed worm's AI movement, a playable version is close



commit 6b99714cdf21aa242c49549f5fe427865e7a63ab
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Tue Jul 7 23:33:40 2009 -0400

    Disabled logo, fixed worm's AI movement, a playable version is close

 gnibbles/gnibbles.c |   20 ++++++++++----------
 gnibbles/main.c     |   14 ++++++++------
 2 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/gnibbles/gnibbles.c b/gnibbles/gnibbles.c
index 6e7b767..47b51c3 100644
--- a/gnibbles/gnibbles.c
+++ b/gnibbles/gnibbles.c
@@ -157,8 +157,8 @@ gnibbles_load_pixmap (gint tilesize)
       g_object_unref (boni_pixmaps[i]);
 
     boni_pixmaps[i] = gnibbles_load_pixmap_file (bonus_files[i],
-  					                                             4 * tilesize,
-                          						                   4 * tilesize);
+  					                                             2 * tilesize,
+                          						                   2 * tilesize);
   }
 
   for (i = 0; i < 11; i++) {
@@ -186,8 +186,8 @@ gnibbles_load_logo (void)
     g_object_unref (logo_pixmap);
 
   logo_pixmap = gnibbles_load_pixmap_file ("gnibbles-logo.svg",
-                               			            board->width, 
-                                                board->height);
+                               			            board->width * 8, 
+                                                board->height * 8);
 }
 /*
 void
@@ -539,18 +539,18 @@ gnibbles_move_worms (void)
 
   dead = g_new (gint, properties->numworms);
 
-  for (i = 0; i < properties->ai; i++) {
+  for (i = 1; i < properties->numworms; i++) {
     olddir = worms[i]->direction;
-    gnibbles_cworm_ai_move (worms[properties->human + i]);
+    gnibbles_cworm_ai_move (worms[i]);
 
     if (olddir != worms[i]->direction)
       gnibbles_cworm_add_actor (worms[i]);
   }
 
- if (boni->missed > MAXMISSED)
-   for (i = 0; i < properties->numworms; i++)
-     if (worms[i]->score)
-       worms[i]->score--;
+  if (boni->missed > MAXMISSED)
+    for (i = 0; i < properties->numworms; i++)
+      if (worms[i]->score)
+        worms[i]->score--;
 
   for (i = 0; i < boni->numbonuses; i++) {
     if (!(boni->bonuses[i]->countdown--)) {
diff --git a/gnibbles/main.c b/gnibbles/main.c
index 9bae270..50d4bdc 100644
--- a/gnibbles/main.c
+++ b/gnibbles/main.c
@@ -126,7 +126,7 @@ static GtkAction *scores_action;
 static GtkAction *fullscreen_action;
 static GtkAction *leave_fullscreen_action;
 
-static ClutterActor *landing_page;
+static ClutterGroup *landing_page;
 
 static void
 hide_cursor (void)
@@ -293,7 +293,7 @@ configure_event_cb (GtkWidget * widget, GdkEventConfigure * event, gpointer data
         gnibbles_cworm_resize (worms[i], tilesize);
     }
   } else {
-    render_logo ();
+    //render_logo ();
   }
 
   /* But, has the tile size changed? */
@@ -497,7 +497,7 @@ end_game (gboolean show_splash)
   }
 
   if (show_splash) {
-    render_logo ();
+    //render_logo ();
     gtk_action_set_sensitive (new_network_action, TRUE);
     gtk_action_set_sensitive (pause_action, FALSE);
     gtk_action_set_sensitive (resume_action, FALSE);
@@ -880,7 +880,7 @@ render_logo (void)
   ClutterColor actor_color = {0xff,0xff,0xff,0xff};
 
   ClutterActor *stage = gnibbles_board_get_stage (board);
-  landing_page = clutter_group_new ();
+  landing_page = CLUTTER_GROUP (clutter_group_new ());
 
   clutter_actor_get_size (CLUTTER_ACTOR (stage), &width, &height);
  
@@ -918,7 +918,9 @@ render_logo (void)
 static void
 hide_logo (void)
 {
-  clutter_actor_hide (CLUTTER_ACTOR (landing_page));
+  ClutterActor *tmp = gnibbles_board_get_stage (board);
+  clutter_container_remove_actor (CLUTTER_CONTAINER (tmp), 
+                                  CLUTTER_ACTOR (landing_page));
 }
 
 int
@@ -978,7 +980,7 @@ main (int argc, char **argv)
   network_gui_update ();
 #endif
 
-  render_logo ();
+  //render_logo ();
 
   gtk_action_set_sensitive (pause_action, FALSE);
   gtk_action_set_sensitive (resume_action, FALSE);



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