Exemplo n.º 1
0
void respawn_player(int x, int y)
{
    set_player_position(x, y);
    current_player.vy = 0;
    current_player.vx = 0;
    current_player.state = 0;
}
Exemplo n.º 2
0
int				create_player(int argc, char **argv)
{
	t_player	*p;

	p = get_player(get_shmem()->nb_user - 1);
	if (argc < 2)
		return (usage());
	p->team = atoi(argv[1]);
	if (p->team <= 0 || p->team > MAX_TEAM)
		return (usage());
	set_player_position(p);
	p->pid = getpid();
	p->is_active = 1;
	printf("Create new player pid %d team %d x %d y %d\n",
			p->pid, p->team, p->x, p->y);
	return (0);
}