Exemple #1
0
void		ft_play_game(t_player **p, t_env **e)
{
	while (1)
	{
		ft_close_sem(*p);
		ft_move_player(p, e);
		ft_open_sem(*p);
	}
}
Exemple #2
0
void		ft_play_game(t_player **p, t_env **e)
{
	while (1)
	{
		ft_close_sem(1);
		ft_putstr("close\n");
		ft_move_player(p, e);
		ft_putstr("open\n");
		ft_open_sem(1);
	}
}
Exemple #3
0
void		ft_change_player_pos(char *buffer, t_env *env)
{
	char	**arg;
	int		id;

	arg = ft_strsplit(buffer, ' ');
	id = ft_atoi(arg[1]);
	env->map[env->pl[id].pos.y][env->pl[id].pos.x].ids[id] = FALSE;
	ft_move_player(env, id);
	env->pl[id].pos.x = ft_atoi(arg[2]);
	env->pl[id].pos.y = ft_atoi(arg[3]);
	env->pl[id].dvec.x = ft_atoi(arg[4]);
	env->map[env->pl[id].pos.y][env->pl[id].pos.x].ids[id] = TRUE;
	check_player(env, env->pl[id].pos.x, env->pl[id].pos.y,
			env->display->level);
}