Example #1
0
int		ft_move_down(t_game *g)
{
	int		score;
	int		i;
	int		j;

	score = 0;
	g->move = 0;
	i = g->size_g - 1;
	while (i > 0)
	{
		j = 0;
		while (j < g->size_g)
		{
			if (g->grid[i][j])
				score += ft_check_down(g, i, j);
			else
				ft_down_number(g, i, &j);
			j++;
		}
		i--;
	}
	if (g->move)
		ft_add_random(g);
	return (score);
}
Example #2
0
int	ft_check_t_piece(t_tetro *tetro, t_piece *pieces)
{
	return (ft_check_down(tetro, pieces) || ft_check_up(tetro, pieces) \
			|| ft_check_vertical_droit(tetro, pieces) \
			|| ft_check_vertical_gauche(tetro, pieces));
}