Creating a Memory Match Game

Favourite 117 favourites
Tutorial written by kittiewanOriginally published on 29th, March 2012 - 17 revisions


This series of video tutorials for more advanced Construct 2 beginners guides you step-by-step through the creation of a memory match card game with Construct 2. You’ll learn to resize and arrange game objects on the fly depending on window size. You’ll create and randomize an array. You’ll use simple math in cool ways to arrange objects and test for matches. And at the end you’ll have a game that you can play or customize and polish to make it your own.

If you want to try the game before you continue, you’ll find a playable demo in the Scirra Arcade.

Required Stuff

To complete the tutorial you will need the following:
Construct 2, downloadable here. You can use either the free or paid edition to complete the tutorial.

Memory Match Tutorial bundle which includes card graphics you can use for the tutorial and as a model for your own original graphics. Also includes a complete, commented version of the Memory Match game. (Note that loading the game project files requires Construct 2 release 84 or later. Also, when Part 5 of the tutorial was posted, the Memory Match Tutorial bundle was updated to include additional0000 card graphics as well as the partially completed .capx for each episode.)

(Optional) Music and sound effects from Scirra’s free bundle.

A Note on Construct 2 Versions

This tutorial was created using Construct 2 Release 84, which was the stable release at the time. You'll need Release 84 or later to open the project files included in the Memory Match Tutorial bundle.

Construct 2 is a work in progress and the user interface is subject to change. From time to time I will add notes to this section to indicate the major interface changes you should be aware of.

Beginning with Release 86, the context menu items to add a sub-event or a blank sub-event are now under the Add submenu.

Part 1: Creating a Card Object

Video Part 1a

(If you don't see the video, follow this link to view Part 1a.)

Video Part 1b

(If you don't see the video, follow this link to view Part 1b.)


Kyatric 75.5k rep

This represents a great amount of work achieved, thank you kittiewan to have taken the time to do it.

I've corrected the youtube links, but they only display under Chrome (as tinier than expected). In FF it's a no show. It was reported once, I hope @Tom noticed ^^

I must admit I've been surprised by your choice of using duplicated frames for matching cards, I'm waiting to see the rest of the tut to see where you go from there, I'll have a look into the capx to see too :)

Again, awesome to have undertaken this huge work keep it up !

Edit: Oh noes ! Dropbox report a 404 error. Guess I'll have to wait ^^
Edit2: The cheat sheet is also a nice attention

Friday, March 30, 2012 at 12:27:59 AM
kittiewan 12.5k rep

Thank you so much, Kyatric. I'll check the 404 error.

Friday, March 30, 2012 at 2:19:53 AM
ZaksCommunicates 3,426 rep

Thumbs up man.

Friday, March 30, 2012 at 5:24:30 AM
Kyatric 75.5k rep

This all works now.
And simple solutions enough. Duplicating the frames truely bring some advantage to the coding of the mechanics.

Again good job, keep it up, this tutorial needs more votes.

Friday, March 30, 2012 at 10:14:26 AM
MonDieu 7,404 rep

Awesome tutorial! Can´t wait for the next part! :)

Friday, March 30, 2012 at 1:11:10 PM
kalon 2,907 rep

Fantastic tutorial! I'm just getting started with Construct2 but I'm eager to start working on games to help my kindergarten students review vocabulary and phonics I've taught. This tutorial is of great help for many types of games I'd like to make.

One problem I'm having though: I'd like to have a unique sound for each card clicked on. I've tried "play (by filename)" with audio clips being named as numbers so that I can call the variable from the array to play the files but it doesn't seem to work. Any ideal of how I can do this?

Thanks for any help and thanks again for the great tutorial.

Sunday, April 01, 2012 at 12:53:26 PM
Kyatric 75.5k rep

@kalon: maybe this capx : will help you.

Your logic is correct, hopefully it will help you figure out what went wrong.

Sunday, April 01, 2012 at 3:58:58 PM
kalon 2,907 rep

@Kyatric Thanks I see now that I need to call the variable as a string.

Monday, April 02, 2012 at 12:48:36 PM
vidi 5,058 rep

@kittiewan, that is exactly where I was looking for. You are so wonderful.
I Thank you for making this videos and sharing with us. I can not good english understand , but your explain it easy to follow . I have so much learned. Thanks so much ! :)

Sunday, April 08, 2012 at 11:44:14 PM
Mivo 3,396 rep

Awesome job with this, both the tutorial and the game! I had been dabbling with a memory-style game, and your tutorial perfectly addressed my array troubles. Thank you! :)

Friday, April 13, 2012 at 1:16:40 PM
kittiewan 12.5k rep

Thanks everyone for the great feedback and kind words. The final episode is now up.

Saturday, April 14, 2012 at 6:34:51 PM
Potato 8,118 rep

@kittiewan this is awesome tutorial, thanks a lot for sharing this :D

Friday, April 20, 2012 at 3:17:34 AM
gazoogle 6,057 rep

Great tutorial, thank you for doing this. I'd also like to point out that in the copy and paste statements here, the gCardHeight is missing a plus between gNumberRows and 1. I think its something in the message board, since the plus symbol did not show up in my original note. Its like that in both chrome and firefox.

Thursday, April 26, 2012 at 4:03:06 AM
kittiewan 12.5k rep

So glad you like it, Potato and gazoogle.

And a good catch, gazoogle. Thank you for pointing it out. I think you're right that the plus sign seems to not get pasted into the message board. Couldn't get them to work here at all, but in the tutorial they finally seemed to take after several attempts. Hopefully I've fixed all of the instances.

Thursday, April 26, 2012 at 4:10:10 PM
gazoogle 6,057 rep

I'd like to add a little more now that I have finished the whole tutorial. Really great for learning the basics of arrays. Great for visual learners - great for watching you step by step seeing little "bugs" and stomping them. Super tutorial. Thanks a bunch.

Thursday, April 26, 2012 at 11:48:57 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.