I want to build a matching game where the same Sprite is not used to make up the pair. (So instead of two apples make a pair, an apple and an orange make the pair.) I can make the normal game work, no problem. But I can’t figure out the easiest way to approach this.
Three easy steps to success:
-
make the normal “memory” matching game
-
extract the comparison function (i.e., call a function and pass in the two proposed cards the player flipped, don’t just test for equality)
-
replace the comparison function with something that accepts a list of acceptable combinations that are considered “same same”
-
PROFIT!
2 Likes