create a memory match game with difficulty setting

0 favourites
  • 10 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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?

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

    <img src="http://img716.imageshack.us/img716/3613/cardcm.png" border="0" />

    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.

  • Cute. Good luck with it, and keep me posted! I'd love to see how it progresses.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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*

  • HEY kittiewan if I have 26 frames(before duplicate) and I just want to show 6 cards(3*2). What should I do then ?

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