Index: game.c
===================================================================
RCS file: /cvs/gnome/gnome-games/gnobots2/game.c,v
retrieving revision 1.19
diff -u -p -r1.19 game.c
--- game.c	5 Jul 2004 11:36:07 -0000	1.19
+++ game.c	3 Apr 2005 14:46:49 -0000
@@ -39,7 +39,7 @@
 /**********************************************************************/
 /* Exported Variables                                                 */
 /**********************************************************************/
-gint         game_state = STATE_NOT_PLAYING;
+gint         game_state = STATE_PLAYING;
 /**********************************************************************/
 
 
@@ -450,25 +450,23 @@ update_arena (void)
     }
   }
 
-  if (game_state != STATE_NOT_PLAYING) {
-    if (arena[player_xpos][player_ypos] != OBJECT_PLAYER) {
-      game_state = STATE_DEAD;
-      play_sound (SOUND_DIE);
-      arena[player_xpos][player_ypos] = OBJECT_PLAYER;
-      endlev_counter = 0;
-      add_aieee_bubble (player_xpos, player_ypos);
-      player_animation_dead ();
-      set_move_menu_sensitivity (FALSE);
-    }
-
-    if ((num_robots1 + num_robots2) <= 0) {
-      game_state = STATE_COMPLETE;
-      play_sound (SOUND_YAHOO);
-      endlev_counter = 0;
-      add_yahoo_bubble (player_xpos, player_ypos);
-      reset_player_animation ();
-      set_move_menu_sensitivity (FALSE);
-    }
+  if (arena[player_xpos][player_ypos] != OBJECT_PLAYER) {
+    game_state = STATE_DEAD;
+    play_sound (SOUND_DIE);
+    arena[player_xpos][player_ypos] = OBJECT_PLAYER;
+    endlev_counter = 0;
+    add_aieee_bubble (player_xpos, player_ypos);
+    player_animation_dead ();
+    set_move_menu_sensitivity (FALSE);
+  }
+
+  if ((num_robots1 + num_robots2) <= 0) {
+    game_state = STATE_COMPLETE;
+    play_sound (SOUND_YAHOO);
+    endlev_counter = 0;
+    add_yahoo_bubble (player_xpos, player_ypos);
+    reset_player_animation ();
+    set_move_menu_sensitivity (FALSE);
   }
 
   display_updated = FALSE;
@@ -531,12 +529,7 @@ timeout_cb (void *data)
 	  show_scores (sp);
 	}
       }
-      game_state = STATE_NOT_PLAYING;
-      remove_bubble ();
-      reset_player_animation ();
-      clear_game_area ();
-      create_demo_objects ();      
-      game_state = STATE_NOT_PLAYING;
+      start_new_game ();
     }
   }
 
@@ -578,34 +571,6 @@ create_game_timer (void)
 
 
 /**
- * create_demo_objects
- *
- * Description:
- * Creates objects for the initial 'demo' screen
- **/
-static void
-create_demo_objects (void)
-{
-  clear_arena ();
-
-  arena[22][15] = OBJECT_PLAYER;
-
-  arena[22][9] = OBJECT_ROBOT1;
-  arena[22][21] = OBJECT_ROBOT1;
-
-  arena[28][15] = OBJECT_ROBOT2;
-  arena[16][15] = OBJECT_ROBOT2;
-
-  arena[28][9] = OBJECT_HEAP;
-  arena[28][21] = OBJECT_HEAP;
-  arena[16][9] = OBJECT_HEAP;
-  arena[16][21] = OBJECT_HEAP;
-
-  gnobots_statusbar_set (0, 0, 0, 0, 0);
-}
-
-
-/**
  * init_game
  *
  * Description:
@@ -614,16 +579,12 @@ create_demo_objects (void)
 void
 init_game (void)
 {
-  clear_game_area ();
-
-  create_demo_objects ();
-
   create_game_timer ();
 
   g_signal_connect (GTK_OBJECT (app), "key_press_event",
-                    GTK_SIGNAL_FUNC (keyboard_cb), 0);  
+                    GTK_SIGNAL_FUNC (keyboard_cb), 0);
 
-  set_move_menu_sensitivity (FALSE);
+  start_new_game ();
 }
 
 
@@ -1357,11 +1318,6 @@ gboolean mouse_cb (GtkWidget * widget, G
 {
   int dx, dy;
 
-  if (game_state == STATE_NOT_PLAYING) {
-    start_new_game ();
-    return TRUE;
-  }
-
   if (game_state != STATE_PLAYING)
     return TRUE;
 
Index: gbdefs.h
===================================================================
RCS file: /cvs/gnome/gnome-games/gnobots2/gbdefs.h,v
retrieving revision 1.3
diff -u -p -r1.3 gbdefs.h
--- gbdefs.h	16 May 2003 07:46:50 -0000	1.3
+++ gbdefs.h	3 Apr 2005 14:46:49 -0000
@@ -84,7 +84,6 @@
 /*
  * Game states
  */
-#define STATE_NOT_PLAYING 0
 #define STATE_PLAYING     1
 #define STATE_WAITING     2
 #define STATE_COMPLETE    3
Index: properties.c
===================================================================
RCS file: /cvs/gnome/gnome-games/gnobots2/properties.c,v
retrieving revision 1.26
diff -u -p -r1.26 properties.c
--- properties.c	18 Jul 2004 01:20:57 -0000	1.26
+++ properties.c	3 Apr 2005 14:46:50 -0000
@@ -512,6 +512,8 @@ type_selection (GtkWidget *widget, gpoin
   gconf_set_configuration (game_config_name (properties.selected_config));
 
   set_game_config (properties.selected_config);
+
+  start_new_game ();
 }
 
 
@@ -742,111 +744,105 @@ show_properties_dialog (void)
   hbox = gtk_hbox_new (TRUE, GNOME_PAD);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, GNOME_PAD);
 
-  if (game_state == STATE_NOT_PLAYING) {
-    typemenu = gtk_combo_box_new_text ();
-    g_signal_connect (G_OBJECT (typemenu), "changed",
-                      G_CALLBACK (type_selection), NULL);
-    fill_typemenu (typemenu);
-    gtk_box_pack_start_defaults (GTK_BOX (hbox), typemenu);
-
-    list = gtk_list_store_new (NCOLS,
-                               G_TYPE_STRING, /* Property */ 
-                               G_TYPE_STRING, /* Value */
-                               G_TYPE_INT); /* Index - remains hidden */
-    /* Create view */
-    list_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list));
-    g_object_unref (list); /* Do I need to create a list store? */
-
-    renderer = gtk_cell_renderer_text_new ();
-    column = gtk_tree_view_column_new_with_attributes (_("Property"), 
-                                                       renderer, 
-                                                       "text", PROPERTY_STRING, 
-                                                       NULL);
-    gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column);
+  typemenu = gtk_combo_box_new_text ();
+  g_signal_connect (G_OBJECT (typemenu), "changed",
+                    G_CALLBACK (type_selection), NULL);
+  fill_typemenu (typemenu);
+  gtk_box_pack_start_defaults (GTK_BOX (hbox), typemenu);
+
+  list = gtk_list_store_new (NCOLS,
+                             G_TYPE_STRING, /* Property */ 
+                             G_TYPE_STRING, /* Value */
+                             G_TYPE_INT); /* Index - remains hidden */
+  /* Create view */
+  list_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list));
+  g_object_unref (list); /* Do I need to create a list store? */
+
+  renderer = gtk_cell_renderer_text_new ();
+  column = gtk_tree_view_column_new_with_attributes (_("Property"), 
+                                                     renderer, 
+                                                     "text", PROPERTY_STRING, 
+                                                     NULL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column);
     
-    renderer = gtk_cell_renderer_text_new ();
-    column = gtk_tree_view_column_new_with_attributes (_("Value"), 
-                                                       renderer, 
-                                                       "text", VALUE_STRING, 
-                                                       NULL);
-    gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column);
+  renderer = gtk_cell_renderer_text_new ();
+  column = gtk_tree_view_column_new_with_attributes (_("Value"), 
+                                                     renderer, 
+                                                     "text", VALUE_STRING, 
+                                                     NULL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column);
 
-    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list_view));
-    gtk_tree_selection_set_mode  (selection, GTK_SELECTION_SINGLE);
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list_view));
+  gtk_tree_selection_set_mode  (selection, GTK_SELECTION_SINGLE);
 
 #if 0
-    gtk_clist_set_column_width (GTK_CLIST (clist), 0, 400);
-    gtk_clist_set_column_width (GTK_CLIST (clist), 1, 50);
-    gtk_clist_column_titles_passive (GTK_CLIST (clist));
-    gtk_clist_column_titles_show (GTK_CLIST (clist));
+  gtk_clist_set_column_width (GTK_CLIST (clist), 0, 400);
+  gtk_clist_set_column_width (GTK_CLIST (clist), 1, 50);
+  gtk_clist_column_titles_passive (GTK_CLIST (clist));
+  gtk_clist_column_titles_show (GTK_CLIST (clist));
 #endif
 
-    fill_property_list ();
+  fill_property_list ();
 
-    /*gtk_widget_set_size_request (list_view, 300, 200);*/
+  /*gtk_widget_set_size_request (list_view, 300, 200);*/
 
-    scrolled = gtk_scrolled_window_new (NULL, NULL);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
-                                    GTK_POLICY_AUTOMATIC,
-                                    GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_shadow_type 
-      (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN);
-    gtk_widget_set_size_request (scrolled, 400, 200);
-    gtk_container_add (GTK_CONTAINER (scrolled), list_view);
-
-    gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, GNOME_PAD_SMALL);
-
-    frame = games_frame_new (_("Options"));
-    gtk_box_pack_start (GTK_BOX (cpage), frame, TRUE, TRUE, GNOME_PAD);
-    vbox = gtk_vbox_new (TRUE, 6);
-    gtk_container_add (GTK_CONTAINER (frame), vbox);
-
-    table = gtk_table_new (2, 2, TRUE);
-    gtk_table_set_row_spacings (GTK_TABLE (table), 6);
-    gtk_table_set_col_spacings (GTK_TABLE (table), 6);
-    gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, GNOME_PAD);
-
-    chkbox = gtk_check_button_new_with_label (_("Use safe moves"));
-    GTK_TOGGLE_BUTTON (chkbox)->active = properties.safe_moves;
-    g_signal_connect (G_OBJECT (chkbox), "clicked",
-                      (GtkSignalFunc)safe_cb, NULL);
-    gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 0, 1, 0, 1);
-    gtk_tooltips_set_tip (tooltips, chkbox,
-			  _("Prevent some dangerous moves"), 
-			  _("Prevent accidental moves that result in getting killed."));
-
-    chkbox = gtk_check_button_new_with_label (_("Use super safe moves"));
-    GTK_TOGGLE_BUTTON (chkbox)->active = properties.super_safe_moves;
-    g_signal_connect (G_OBJECT (chkbox), "clicked",
-                      (GtkSignalFunc)super_safe_cb, NULL);
-    gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 0, 1, 1, 2);
-    gtk_tooltips_set_tip (tooltips, chkbox,
-			  _("Prevent all dangerous moves"), 
-			  _("Prevents all moves that result in getting killed."));
-
-    chkbox = gtk_check_button_new_with_label (_("Enable sounds"));
-    GTK_TOGGLE_BUTTON (chkbox)->active = properties.sound;
-    g_signal_connect (G_OBJECT (chkbox), "clicked",
-                      (GtkSignalFunc)sound_cb, NULL);
-    gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 1, 2, 0, 1);
-    gtk_tooltips_set_tip (tooltips, chkbox,
-			  _("Play sounds for major events"), 
-			  _("Play sounds for events like winning a level and dying."));
-
-    chkbox = gtk_check_button_new_with_label (_("Enable splats"));
-    GTK_TOGGLE_BUTTON (chkbox)->active = properties.splats;
-    g_signal_connect (G_OBJECT (chkbox), "clicked",
-                      (GtkSignalFunc)splat_cb, NULL);
-    gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 1, 2, 1, 2);
-    gtk_tooltips_set_tip (tooltips, chkbox,
-			  _("Play a sound when two robots collide"), 
-			  _("Play the most common, and potentially the most annoying, sound."));
-
-  } else {
-    label = gtk_label_new (_("You Cannot Change the Game Type When Playing"));
-    gtk_box_pack_start_defaults (GTK_BOX (hbox), label);
+  scrolled = gtk_scrolled_window_new (NULL, NULL);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
+                                  GTK_POLICY_AUTOMATIC,
+                                  GTK_POLICY_AUTOMATIC);
+  gtk_scrolled_window_set_shadow_type 
+    (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN);
+  gtk_widget_set_size_request (scrolled, 400, 200);
+  gtk_container_add (GTK_CONTAINER (scrolled), list_view);
+
+  gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, GNOME_PAD_SMALL);
+
+  frame = games_frame_new (_("Options"));
+  gtk_box_pack_start (GTK_BOX (cpage), frame, TRUE, TRUE, GNOME_PAD);
+  vbox = gtk_vbox_new (TRUE, 6);
+  gtk_container_add (GTK_CONTAINER (frame), vbox);
+
+  table = gtk_table_new (2, 2, TRUE);
+  gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+  gtk_table_set_col_spacings (GTK_TABLE (table), 6);
+  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, GNOME_PAD);
+
+  chkbox = gtk_check_button_new_with_label (_("Use safe moves"));
+  GTK_TOGGLE_BUTTON (chkbox)->active = properties.safe_moves;
+  g_signal_connect (G_OBJECT (chkbox), "clicked",
+                    (GtkSignalFunc)safe_cb, NULL);
+  gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 0, 1, 0, 1);
+  gtk_tooltips_set_tip (tooltips, chkbox,
+			_("Prevent some dangerous moves"), 
+			_("Prevent accidental moves that result in getting killed."));
+
+  chkbox = gtk_check_button_new_with_label (_("Use super safe moves"));
+  GTK_TOGGLE_BUTTON (chkbox)->active = properties.super_safe_moves;
+  g_signal_connect (G_OBJECT (chkbox), "clicked",
+                    (GtkSignalFunc)super_safe_cb, NULL);
+  gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 0, 1, 1, 2);
+  gtk_tooltips_set_tip (tooltips, chkbox,
+			_("Prevent all dangerous moves"), 
+			_("Prevents all moves that result in getting killed."));
+
+  chkbox = gtk_check_button_new_with_label (_("Enable sounds"));
+  GTK_TOGGLE_BUTTON (chkbox)->active = properties.sound;
+  g_signal_connect (G_OBJECT (chkbox), "clicked",
+                    (GtkSignalFunc)sound_cb, NULL);
+  gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 1, 2, 0, 1);
+  gtk_tooltips_set_tip (tooltips, chkbox,
+			_("Play sounds for major events"), 
+			_("Play sounds for events like winning a level and dying."));
+
+  chkbox = gtk_check_button_new_with_label (_("Enable splats"));
+  GTK_TOGGLE_BUTTON (chkbox)->active = properties.splats;
+  g_signal_connect (G_OBJECT (chkbox), "clicked",
+                    (GtkSignalFunc)splat_cb, NULL);
+  gtk_table_attach_defaults (GTK_TABLE (table), chkbox, 1, 2, 1, 2);
+  gtk_tooltips_set_tip (tooltips, chkbox,
+			_("Play a sound when two robots collide"), 
+			_("Play the most common, and potentially the most annoying, sound."));
 
-  }
   label = gtk_label_new_with_mnemonic (_("Game"));
   gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cpage, label);
 
