Exemple #1
0
void		add_player(t_server *server, t_player *player, int w, int h)
{
  int		x;
  int		y;

  x = rand() % w;
  y = rand() % h;
  if (server)
    add_player_to_pos(server, player, x, y);
}
Exemple #2
0
void		create_player_at_pos(t_server *server, t_client *client, \
				     int x, int y)
{
  t_player	*player;

  player = xmalloc(sizeof(t_player));
  init_player(player, client->socket, client->team);
  add_player_to_pos(server, player, x, y);
  player->client = client;
  client->player = player;
}
Exemple #3
0
bool	place_player(t_clientIA *player, t_map *map)
{
  if (add_player_to_pos(player, map, player->x, player->y) == false)
    return (false);
  return (true);
}