Hi,
I work on a card game where you have to match several tiles to others.
To compare if something matches i have a small function on all cards.
The problem is, i don’t know how can i check the game is won, when all possible tiles match with each other.
public void CheckColors()
{
//if there is anything on the top of this card && the top cards bottom is matching this top
if(ccTop != null && ccTop.Bottom == Top && ccTop.formBottom != formTop)
{
//color match
Debug.Log ("Colors and Form are matching in the top");
}
if(ccRight != null && ccRight.Left == Right && ccRight.formLeft != formRight)
{
//color match
Debug.Log ("Colors and Form are matching in the right");
}
if (ccBottom != null && ccBottom.Top == Bottom && ccBottom.formTop != formBottom)
{
//color match
Debug.Log ("Colors and Form are matching in the bottom");
}
if (ccLeft != null && ccLeft.Right == Left && ccLeft.formRight != formLeft)
{
//color match
Debug.Log ("Colors and Form are matching in the left");
}
}
Since i can move around tiles and also rotate them, i would like to know how can i tell the game i have all possible matches?
The matching works already.