![]() Sets Matched - Number - to display the score in the HUD Sets Remaining - Number - to keep track of the remaining sets Cards Flipped - List - to keep track of which cards are flipped over I need to make some game attributes to control the game flow. TLDR: Send user feedback to a text variable, draw the text variable in an actor. I have covered creating a super easy HUD in another post. We also need some feedback because reading the log viewer in flash isn’t really ideal. We know we are going to be applying this behavior to a card later, so while building the card behavior we need to keep that in mind and use the available attributes to keep any actions as generic as possible. Test your game! When you click a card, does it show the face of the card? If not, go back and make that happen before moving on. When the card is pressed we switch to the front animation So we will add the following actions to the events tab of the Ace of Spades actor. Then I brought 2 Ace of Spades actors out onto the stage.Īt it’s most simplest, we need to flip a card when the player clicks on it. We need a scene for this all to take place. Back should be the first animation (the one with the star), as it will be the one shown when we start. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |