示例#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);
}
示例#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;
}
示例#3
0
文件: map_utils.c 项目: gillioa/Zappy
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);
}