Update the memory card game so that it tracks number of matches, number of moves, and whether or not the game has been won. Additionally, have the class inherit from IActivity so that the game is considered an activity with all its necessary functions.
Ideally, this means it can integrate nicely with the overall activity tracking system. The moves tracker can be used to feed into the change rate for sanity or whatever.
Testing
To test this a bit easier, simply disable some of the playing cards in the prefab in whatever scene you're in. Maintain an even number of cards, of course. Debug logs should reflect the updates.
Changelist:
Make class MemoryGame also inherit from IActivity.
Implement IActivity methods and members in class MemoryGame.
Add CheckWon method to check whether all cards have been matched and set the game as won.
Add _matches member variable to track the number of correct matches.
Add _moves member variable to track the total number of moves.
Description
Update the memory card game so that it tracks number of matches, number of moves, and whether or not the game has been won. Additionally, have the class inherit from
IActivity
so that the game is considered an activity with all its necessary functions.Ideally, this means it can integrate nicely with the overall activity tracking system. The moves tracker can be used to feed into the change rate for sanity or whatever.
Testing
To test this a bit easier, simply disable some of the playing cards in the prefab in whatever scene you're in. Maintain an even number of cards, of course. Debug logs should reflect the updates.
Changelist:
MemoryGame
also inherit fromIActivity
.IActivity
methods and members in classMemoryGame
.CheckWon
method to check whether all cards have been matched and set the game as won._matches
member variable to track the number of correct matches._moves
member variable to track the total number of moves.