Esempio n. 1
0
static void	to_graphic(t_game *game, t_player *player)
{
  char		buff[512];

  (void)game;
  bzero(buff, sizeof(buff));
  sprintf(buff, G_PLAYER_POS,
	  player->num,
	  player->pos.x,
	  player->pos.y,
	  player->direction);
  send_to_graphic(game, buff);
}
Esempio n. 2
0
File: data.c Progetto: fave-r/Zappy
void	add_rand_food(t_zap *data, int nb, t_user *usr)
{
  int	x;
  int	y;
  char	tmp[150];

  x = rand() % data->width;
  y = rand() % data->length;
  data->map[x][y].food += nb;
  bzero(tmp, 150);
  sprintf(tmp, "bct %d %d %d %d %d %d %d %d %d\n", x, y,
	  (int)data->map[x][y].food, (int)data->map[x][y].linemate,
	  (int)data->map[x][y].deraumere, (int)data->map[x][y].sibur,
	  (int)data->map[x][y].mendiane, (int)data->map[x][y].phiras,
	  (int)data->map[x][y].thystame);
  send_to_graphic(tmp, usr);
  verbose_eat(usr, x, y, data);
}