0 Favourites

Make a snap card game

  • Hi

    I have been racking my brains (or what is left of them) to work out the best way to create a card game called snap but instead of matching pictures, one side of cards will have a word or phrase in French and the other side in English.

    I have found out how to create a "flip" effect now and when it flips , it shows text so I am starting in the right direction but I need to be able to create more than one card on each side with their text generated randomly and then when the user chooses a card (also how to do this) from each, the game can check and state whether it is correct or not

  • that's a tough one! you might have to get cards made with two animations. One for the English and the other with French. then you can spawn random cards from like card placements on the field. when card is flipped you set it to animation 2/English side... something like that lol practice with just some card images you can get online and see how that goes trying to spawn random cards and flipping them over.

  • Hi mikewalton206 thanks for your reply. I have already figured out the animation part of the project, my main issue is how to match the text objects that only appear when the cards are flipped over, I have since thought that the cards could be dragged into a central "box" but they would still need to be some logic to match them or if they do not match to snap them back to their location

  • Hmm... maybe you could use variables. Card 1 could be match1 and if card = match1 then call this function and then so on for each card. If it doesn't match you can call a function that puts the card back. Maybe that could work 🤔

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hmm... maybe you could use variables. Card 1 could be match1 and if card = match1 then call this function and then so on for each card. If it doesn't match you can call a function that puts the card back. Maybe that could work ??

    Yes but how would I best store the information to make the check ? My first thoughts were to feed the French and English meanings into an array so that the first row would be french and the second would be english.

    My only issue then would be how to jumble the values up to assign them to each card but also find a way of matching them up as well. When I thought about that, I then wondered if there was a way to store the array positions against each card via a variable. All of this would have to be done when each card is spawned randomly on each side of the display.

    My aim is to have e.g. the french cards on the left, the "matching drop box" in the middle and the english cards on the right. Then when two cards are dropped into the "matching drop box" the game checks to see if they are correct.

  • timcs try Rex MATCH PLUGIN FOR c2

    ALSO YOU WILL FIND THIS PLUGIN IN MY DROPBOX TOO.

  • timcs try Rex MATCH PLUGIN FOR c2

    ALSO YOU WILL FIND THIS PLUGIN IN MY DROPBOX TOO.

    Thanks Lordshiva1948 I will look at this and give it a go , funny thing is , I have used plugins from Rex before and I did check the site but was not looking hard enough . Currently using his CSVtoArray plugin to get the data from a google online exported spreadsheet from a tutorial I read here.

  • The match test ought to be simple enough. Each French card could have an instance variable that contains the English phrase that it will accept as a match. For example the Bonjour card could have an instance variable called correctMatch that contains "hello", etc. When you drop two cards in the box it compares the English string to what the French card is looking for and tells you if it hits or not.

    You'll have to make sure that both halves of a correct match get put on the same screen together so you don't end up with a jumble of random card words that don't match up. So maybe at level start you could pull matches out of the array to populate both sides of the cards. Eg

    Level start - set French card 1 to random thing from array.

    For example the game pulls "Maison"

    Now pull the English translation and populate French card 1's correctMatch variable and also one of the English display cards at random.

    So, French card 1's correctMatch = "House"

    [random English card] - eg English card 7 becomes "House".

    If you set up the array so the French and English are always next to each other this oughtn't to be too hard to do.

    Eg

    0,0 = "Maison"

    0,1 = "House"

    1,0 = "Carotte"

    1,1 = "Carrot"

    2,0 = "Ours"

    2,1 = "Bear"

    and so on.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)