create a memory match game with difficulty setting

Get help using Construct 2

Post » Thu Aug 23, 2012 3:17 pm

Ok. So I ran through the memory match game tutorial and completed my first little memory match game.

What I now want to do before testing it on my HP Pre 3 is having a main menu with several difficulty settings and different themed decks to choose from.

How would I got about it? I already changed the event sheet so everything that said gNumberCards before would say gNumberCards/2, essentially cutting the difficulty level into half.

Now what this did instead was repeating one particular card symbol for every pair but one.

Anyone know what might have triggered this and how I would fix it?

I'd also like to have several differently themed decks (cats, dogs, cars, etc). How would I add those without shuffling them with another set of themed cards?
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Thu Aug 23, 2012 7:21 pm

If you go carefully through the tutorial it shows you how to change the difficulty in video 3b at about 7:25) You don't change the code. All you do is change the global variables gNumberCards, gNumberColumns and gNumberRows. The number of cards must be even and the number of rows * the number of columns must equal the number of cards. So go take out any changes where you made it gNumberCards/2.

To use different decks of cards, just add additional card face and card back animations and set the animations you want to use when you load the layout just like it was shown in the final video for special sets of cards. (You can duplicate existing animations and replace them with your graphics.)

To make it work from the main menu, just make changes to the global variables in the menu before you start the game layout. You'll need to add a global variable for the card back animation and card facenumber of cards and name of the animations you want to use in global variables in the main menu layout. Then call the game layout and issue the set animation action on start of layout.

Hope that helps.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Thu Aug 23, 2012 9:07 pm

Wait a second. Do I understand you correctly? What you're saying is that I can make changes to the global variables during runtime?

The only reason I used the gNumberCards/2, gNumberCards*2 hocus pocus is because I thought I couldn't do that.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Thu Aug 23, 2012 9:18 pm

You can make a menu screen, with easy/medium/hard button, on button clicked set variable:
Easy - Cards 6, Rows 2, Columns 3
Medium - Cards 12, Rows 3, Columns 4
Hard...

How to set variable?
Add Action - System - Set Value - Than select your global variable, and type the value... :)

After set of all the card, row, cols, you can use the Action - System - Go To Layout to start the game.Epox2012-08-23 21:19:43
B
19
S
5
G
4
Posts: 109
Reputation: 4,195

Post » Fri Aug 24, 2012 1:26 am

Yes, what Epox said. He used the same memory match to tutorial to publish a fun children's game, complete with the menus and beautiful graphics. Yeah!

Regarding the confusion on global variables, absolutely you can change them at runtime. However you have to be careful WHEN you change them. You don't want the change the number of cards in the middle of the game, for example. But you can change it at the start of the layout or in a different layout.

In some programming languages there is a concept of constants, where are set at the beginning and are not allowed to change. Construct 2 does not have that concept (although I sometimes pretend it does by convincing myself that any variable I name in all capital letters is not allowed to be changed during the game.


B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Fri Aug 24, 2012 9:19 pm

Gotcha.
Thanks you two.

I now know exactly what to do.

Coming from a purist background (I love coding in all sorts of machine code and everything that is modular/functional), it took me quite some time to wrap my head around Construct 2's principles. Thankfully, it's still more feasible than manually programming in any of those silly OOP languages.

EDIT: Here's one of the art I was going to use in the first, cat themed deck.

Hope the style isn't putting people off.



I'd love to jumpstart my career as a game developer with that little app. I'm currently employed as a regular web developer but wouldn't mind launching my own little indie game label.Blinx1232012-08-24 21:27:05
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Tue Aug 28, 2012 5:11 am

Cute. Good luck with it, and keep me posted! I'd love to see how it progresses.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Tue Aug 28, 2012 8:14 am

@Blinx123 wish you good luck with one of the best learning "templates/tutorials". You will earn good experiance with this memory game, cause you have easy to understand pieces in it and also have some more advanced like arrays - and the handlign of them in C2.

Feel free to get ideas from our published game what is really based in this great tutorial: Alpine Croco Memory Game
B
19
S
5
G
4
Posts: 109
Reputation: 4,195

Post » Wed Dec 04, 2013 6:07 pm

@Kittiewan

Great tutorial!

I have the problem where by I have between 3-5 pairs of the heart image, everything else is peerrfect up to part3b.

I'm not keen to continue further until this problem is fixed, as it could cause more problems later on.

Please help in exchange for a *Free saucer of milk*

B
10
S
2
G
1
Posts: 24
Reputation: 804

Post » Wed Jul 29, 2015 11:50 am

HEY @kittiewan if I have 26 frames(before duplicate) and I just want to show 6 cards(3*2). What should I do then ?
B
6
Posts: 39
Reputation: 345

Next

Return to How do I....?

Who is online

Users browsing this forum: h1k3, Unconnected and 0 guests