To do this I needed a method in the card behaviour that passed the cards information to the game manager upon it being clicked. When two cards have been clicked and passed their information, a co-routine to compare the cards is started. If the two cards match, the tally for pairs needed to win increased, bringing the player one step closer to finishing and they then remain unclickable. If they don't match, both cards are flipped back and made clickable again.
![]() |
Card game partway through |
The final thing to do was provide a win screen when the player matched every card. This was easily done by checking if the pair tally equaled 8 or not. If so then a delegate message is sent to display the win overlay image and I even added music to make it more of a celebration.
![]() |
Finished game with win display |
No comments:
Post a Comment