Beispiel #1
0
void
gnibbles_init (void)
{
  gint i;

  if (!board)
    return;

  for (i = 0; i < properties->numworms; i++) {
    if (worms[i])
      gnibbles_worm_destroy (worms[i]);
  }

  gnibbles_scoreboard_clear (scoreboard);

  for (i = 0; i < properties->numworms; i++) {
    worms[i] = gnibbles_worm_new (i);
    gnibbles_scoreboard_register (scoreboard, worms[i],
                   colorval_name (properties->wormprops[i]->color));
  }

  for (i = 0; i < properties->human; i++)
    worms[i]->human = TRUE;

  gnibbles_scoreboard_update (scoreboard);
}
Beispiel #2
0
void
gnibbles_properties_set_worm_color (gint i, gint value)
{
  char *color_name;

  color_name = colorval_name (value);
  g_settings_set_string (worm_settings[i], "color", color_name);
}
void
gnibbles_properties_set_worm_color (gint i, gint value)
{
  char key[64];
  char *color_name;

  g_snprintf (key, sizeof (key), KEY_WORM_COLOR, i);

  color_name = colorval_name (value);
  games_conf_set_string (KEY_PREFERENCES_GROUP, key, color_name);
}