-void
-create_window (void)
-{
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (window), "robotfindskitten");
- gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &black);
-}
-
-void
-set_up_game (void)
-{
- guint x, y;
-
- g_signal_connect (G_OBJECT (window), "button-press-event", G_CALLBACK (on_window_clicked), NULL);
- g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK (on_key_pressed), NULL);
- g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL);
- gdk_window_set_events (GTK_WIDGET (window)->window,
- gdk_window_get_events(GTK_WIDGET (window)->window) | GDK_BUTTON_PRESS_MASK);
-
- table = gtk_table_new (ARENA_HEIGHT, ARENA_WIDTH, TRUE);
- gtk_container_remove (GTK_CONTAINER (window), GTK_WIDGET (intro));
- gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (table));
-
- robot = gtk_label_new ("#");
- g_object_ref (robot);
- kitten = random_character ("You found kitten! Way to go, robot!");
-
- place_in_arena_randomly (robot);
- place_in_arena_randomly (kitten);
-
- if (nki_count < amount_of_random_stuff)
- {
- gtk_widget_show_all (window);
- show_message ("There are too few non-kitten items to play a meaningful game.");
- exit (EXIT_FAILURE);
- }
-
- for (x=0; x < amount_of_random_stuff; x++)
- place_in_arena_randomly (random_character (description ()));
-
- for (x=0; x < ARENA_WIDTH; x++)
- for (y=0; y < ARENA_HEIGHT; y++)
- if (!arena[x][y])
- place_in_arena_at_xy (gtk_label_new (NULL), x, y);
-
- gtk_widget_show_all (window);
-}
-