- //voila la principale fonction qui détermine les collisions entre couleur.
-
- float FallingSpeed = 0.05f;//Vitesse de chute des blocks
- bool canfall = false;//gachette qui indique si on peut faire tomber les block
- bool fallfinished = true;//gachette qui indique si le block a finit de tomber
- int MaxColor = 5;//nombre de couleur maximale avec lesquelles jouer peut aller jusqu'à 10
- int ContactNeeded = 4;//nombre de contacte a établir avant de faire disparaître les blocks
-
-
- private void MakeLink(int x, int y, ref List<Point> PointList)
- {
- Block mBlock = Plateau[x, y];
- if (mBlock.Color == BlockColor.Aucun || mBlock.Checked) return;
- PointList.Add(new Point(x, y));
- Plateau[x, y].Checked = true;
- if (x + 1 < Bx)
- if (Plateau[x + 1, y].Color == mBlock.Color)
- {
- Plateau[x, y].Liens |= BlockLink.Droite;
- MakeLink(x + 1, y, ref PointList);
- }
- if (y + 1 < By)
- if (Plateau[x, y + 1].Color == mBlock.Color)
- {
- Plateau[x, y].Liens |= BlockLink.Bas;
- MakeLink(x, y + 1, ref PointList);
- }
- if (x - 1 >= 0)
- if (Plateau[x - 1, y].Color == mBlock.Color)
- {
- Plateau[x, y].Liens |= BlockLink.Gauche;
- MakeLink(x - 1, y, ref PointList);
- }
- if (y - 1 >= 0)
- if (Plateau[x, y - 1].Color == mBlock.Color)
- {
- Plateau[x, y].Liens |= BlockLink.Haut;
- MakeLink(x, y - 1, ref PointList);
- }
- }
//voila la principale fonction qui détermine les collisions entre couleur.
float FallingSpeed = 0.05f;//Vitesse de chute des blocks
bool canfall = false;//gachette qui indique si on peut faire tomber les block
bool fallfinished = true;//gachette qui indique si le block a finit de tomber
int MaxColor = 5;//nombre de couleur maximale avec lesquelles jouer peut aller jusqu'à 10
int ContactNeeded = 4;//nombre de contacte a établir avant de faire disparaître les blocks
private void MakeLink(int x, int y, ref List<Point> PointList)
{
Block mBlock = Plateau[x, y];
if (mBlock.Color == BlockColor.Aucun || mBlock.Checked) return;
PointList.Add(new Point(x, y));
Plateau[x, y].Checked = true;
if (x + 1 < Bx)
if (Plateau[x + 1, y].Color == mBlock.Color)
{
Plateau[x, y].Liens |= BlockLink.Droite;
MakeLink(x + 1, y, ref PointList);
}
if (y + 1 < By)
if (Plateau[x, y + 1].Color == mBlock.Color)
{
Plateau[x, y].Liens |= BlockLink.Bas;
MakeLink(x, y + 1, ref PointList);
}
if (x - 1 >= 0)
if (Plateau[x - 1, y].Color == mBlock.Color)
{
Plateau[x, y].Liens |= BlockLink.Gauche;
MakeLink(x - 1, y, ref PointList);
}
if (y - 1 >= 0)
if (Plateau[x, y - 1].Color == mBlock.Color)
{
Plateau[x, y].Liens |= BlockLink.Haut;
MakeLink(x, y - 1, ref PointList);
}
}