I name them, front and back, and make sure they don’t loop. I then add the images of the front and back of the Ace of Spades as animations. In Stencyl I create a new game called “Card Flip Tutorial”Īnd then create a new actor called “Ace of Spades” You will need a front and back of a playing card to start, and later, more fronts of the cards. So we will make a list of the cards that have been flipped.įor the purpose of this tutorial, I found some open source playing card images and converted them to jpegs. Stencyl uses game attributes as global variables, or values that are available to all the actors in the game. else if there are no other cards flipped over, record the type of card flipped so the comparison can be made in the above logicįrom the above pseudo-code we know we are going to have to keep track of the cards that are flipped. else if there is another card flipped over and the two cards do not have the same value, it's not a match, flip both cards back over Remove both cards, add a point to the score if there is another card flipped over that has the same value, it's a match. We are going to build a memory card flipping game using Stencyl 3.0 so lets get the pseudo-code out of the way first, or at least a part of it. It’s the most important part of the game, making it secondary might mean it is not well polished.
In the case of Games I like to build from the main game mechanic outward. You are so much less likely to run into an issue.
As someone who has been coding for many years, I find that building things with small iterations is best. If you are good at coding you might go ahead and do things without testing them and you might not have any issues.