Ejemplo n.º 1
0
/*
 * This does the moves of the game items on the play canvas
 *
 */
static gint wordsgame_move_items (GtkWidget *widget, gpointer data)
{
  g_assert (items!=NULL);
  gint i;
  LettersItem *item;

#if GLIB_CHECK_VERSION(2, 31, 0)
  g_mutex_lock (&items_lock);
#else
  g_static_mutex_lock (&items_lock);
#endif
  for (i=items->len-1;i>=0;i--)
    {
      item=g_ptr_array_index(items,i);
      wordsgame_move_item(item);
    }
#if GLIB_CHECK_VERSION(2, 31, 0)
  g_mutex_unlock (&items_lock);
#else
  g_static_mutex_unlock (&items_lock);
#endif
  dummy_id = g_timeout_add (gc_timing (speed, items->len),
          (GSourceFunc) wordsgame_move_items, NULL);
  return (FALSE);
}
Ejemplo n.º 2
0
/*
 * This does the moves of the game items on the play canvas
 *
 */
static gboolean gletters_move_items (gpointer data)
{
  g_list_foreach (item_list, (GFunc) gletters_move_item, NULL);

  /* Destroy items that falls out of the canvas */
  gletters_destroy_items();

  dummy_id = g_timeout_add (gc_timing (speed, actors_count),
			    gletters_move_items, NULL);

  return(FALSE);
}