Make a snap card game

Just started using Construct 2? Post your questions here

Post » Tue Mar 06, 2018 1:27 pm

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
Regards

TimCS
B
24
S
9
Posts: 137
Reputation: 2,006

Post » Sat Mar 17, 2018 5:01 am

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.
B
37
S
17
G
9
Posts: 170
Reputation: 7,829

Post » Sat Mar 17, 2018 1:21 pm

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
Regards

TimCS
B
24
S
9
Posts: 137
Reputation: 2,006

Post » Sat Mar 17, 2018 4:05 pm

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 🤔
B
37
S
17
G
9
Posts: 170
Reputation: 7,829

Post » Sun Mar 18, 2018 3:04 pm

mikewalton206 wrote: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.
Regards

TimCS
B
24
S
9
Posts: 137
Reputation: 2,006

Post » Mon Mar 19, 2018 3:28 pm

timcs try Rex MATCH PLUGIN FOR c2

ALSO YOU WILL FIND THIS PLUGIN IN MY DROPBOX TOO.
B
267
S
51
G
16
Posts: 2,039
Reputation: 43,944

Post » Mon Mar 19, 2018 9:07 pm

Lordshiva1948 wrote: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.
Regards

TimCS
B
24
S
9
Posts: 137
Reputation: 2,006


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests