Esempio n. 1
0
static void
end_board ()
{

  if(gcomprisBoard!=NULL)
    {
      pause_board(TRUE);
      gc_score_end();
#if GLIB_CHECK_VERSION(2, 31, 0)
      g_mutex_lock (&items_lock);
#else
      g_static_mutex_lock (&items_lock);
#endif
      wordsgame_destroy_all_items();
#if GLIB_CHECK_VERSION(2, 31, 0)
      g_mutex_unlock (&items_lock);
#else
      g_static_mutex_unlock (&items_lock);
#endif
      if (preedit_text){
	goo_canvas_item_remove(preedit_text);
	preedit_text=NULL;
      }
      gc_im_reset();
      gcomprisBoard = NULL;

      if (gc_wordlist != NULL){
	gc_wordlist_free(gc_wordlist);
	gc_wordlist = NULL;
      }
    }

  gc_locale_set( NULL );
}
Esempio n. 2
0
/* set initial values for the next level */
static void
imageid_next_level()
{
  gc_bar_set_level(gcomprisBoard);

  imageid_destroy_all_items();
  selected_button = NULL;
  gamewon = FALSE;

  destroy_board_list();
  init_xml(gcomprisBoard->level);

  gcomprisBoard->number_of_sublevel = g_list_length(board_list);

  gc_score_end();
  gc_score_start(SCORESTYLE_NOTE,
		 BOARDWIDTH - 195,
		 BOARDHEIGHT - 30,
		 gcomprisBoard->number_of_sublevel);

  gc_score_set(gcomprisBoard->sublevel);

  /* Try the next level */
  imageid_create_item(goo_canvas_get_root_item(gcomprisBoard->canvas));
}
Esempio n. 3
0
static void
end_board ()
{
  if(gcomprisBoard!=NULL)
    {
      gc_drag_stop(goo_canvas_get_root_item(gcomprisBoard->canvas));
      pause_board(TRUE);
      scale_destroy_all_items();
      gc_score_end();
    }
  gcomprisBoard = NULL;
}
Esempio n. 4
0
/* =====================================================================
 *
 * =====================================================================*/
static void end_board () {

  if(gcomprisBoard!=NULL){
    pause_board(TRUE);
    gc_score_end();
    colors_destroy_all_items();
    // free list
    while (g_list_length(listColors) > 0)
      listColors = g_list_remove(listColors, g_list_nth_data(listColors,0));
  }
  gcomprisBoard = NULL;
}
Esempio n. 5
0
static void
end_board ()
{

    if(gcomprisBoard!=NULL)
    {
        pause_board(TRUE);
        gc_score_end();
        planegame_destroy_all_items();
        gcomprisBoard->level = 1;       // Restart this game to zero
    }
    gcomprisBoard = NULL;
}
Esempio n. 6
0
/* void gc_score_end(); */
static PyObject*
py_gc_score_end(PyObject* self, PyObject* args)
{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_score_end"))
    return NULL;

  /* Call the corresponding C function */
  gc_score_end();

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}
Esempio n. 7
0
static void end_board ()
{

  if(gcomprisBoard_missing!=NULL)
    {
      pause_board(TRUE);
      gc_score_end();
      missing_letter_destroy_all_items();
      missing_destroy_board_list(board_list);
      board_list = NULL;
    }

  gc_locale_set( NULL );

  gcomprisBoard_missing = NULL;
}
Esempio n. 8
0
static void
end_board ()
{

  if(gcomprisBoard!=NULL)
    {
      pause_board(TRUE);
      gc_score_end();
      imageid_destroy_all_items();
      destroy_board_list();
    }

  gc_locale_set( NULL );

  gcomprisBoard = NULL;
}
Esempio n. 9
0
/* ======================================= */
static void end_board ()
{
  if(gcomprisBoard!=NULL)
    {
      pause_board(TRUE);
      gc_score_end();
      click_on_letter_destroy_all_items();
      g_strfreev(answers);
      g_strfreev(questions);

      g_object_unref(carriage_svg_handle);
      g_object_unref(cloud_svg_handle);
      clear_levels();
    }
  gc_locale_set( NULL );
  gcomprisBoard = NULL;
  gc_sound_bg_resume();
}
Esempio n. 10
0
static void
end_board ()
{
  int i;
  if(gcomprisBoard!=NULL)
    {
      pause_board(TRUE);
      gc_score_end();
      gletters_destroy_all_items();
      g_message("freeing memory");
      for (i = 0; i < maxLevel; i++)
	g_free(letters_array[i]);

      for (i = 0; i < keyMapSize; i++)
	g_free(keyMap[i]);

      g_free(keyMap);
    }

  gc_locale_set( NULL );

  gcomprisBoard = NULL;
}
Esempio n. 11
0
/* set initial values for the next level */
static void planegame_next_level()
{
    RsvgHandle *svg_handle = NULL;
    GooCanvasItem *item;

    gc_bar_set_level(gcomprisBoard);

    planegame_destroy_all_items();

    rootitem = goo_canvas_group_new (goo_canvas_get_root_item(gcomprisBoard->canvas),
                                     NULL);

    clouds_rootitem = goo_canvas_group_new (rootitem, NULL);

    /* Try the next level */
    speed=100+(40/(gcomprisBoard->level));
    fallSpeed=10000-gcomprisBoard->level*200;
    /* Make the images tend to 0.5 ratio */
    imageZoom=0.3+(0.5/(gcomprisBoard->level));

    /* Setup and Display the plane */
    planespeed_y = 0;
    planespeed_x = 0;
    svg_handle = gc_rsvg_load("planegame/tuxhelico.svgz");
    plane_x = 50;
    plane_y = 300;

    planeitem = goo_canvas_group_new (rootitem,
                                      NULL);

    goo_canvas_item_translate(planeitem, plane_x, plane_y);

    item = goo_canvas_svg_new (planeitem,
                               svg_handle,
                               NULL);

    goo_canvas_item_scale(item,
                          0.4 * imageZoom,
                          0.4 * imageZoom);

    g_object_unref(svg_handle);

    /* Game rules */
    plane_target = 1;
    plane_last_target = 10;

    gcomprisBoard->number_of_sublevel=plane_last_target;

    gcomprisBoard->sublevel=plane_target;

    if(gcomprisBoard->level>1)
    {
        /* No scoring after level 1 */
        gc_score_end();
    }
    else
    {
        gc_score_start(SCORESTYLE_NOTE,
                       BOARDWIDTH - 195,
                       BOARDHEIGHT - 30,
                       gcomprisBoard->number_of_sublevel);
        gc_score_set(gcomprisBoard->sublevel);
    }

}