C# Tutorial – Create a Picture Matching Game with .Net in Visual Studio

Hi, in this tutorial we will make a picture matching game. in this game you will match 2 pictures by clicking on the empty picture boxes. The game will load the pictures in random positions in the Grid and when one of them is clicked it will reveal the hidden picture. If two pictures are matched then it will keep both of them on the display. The game will continue until all 6 pictures are matched or if the timer goes to 0. You can restart the game and it will randomize the pictures again in the game so the game is always dynamically changing the locations of the pictures. We will be using picture box tags in the windows form framework to randomly position them across the grid.

There is a older version of this game tutorial available @ super hero memory matching game tutorial. 

Lesson objectives –

  • Make a picture matching game with C# and .Net in Visual Studio
  • Use .Net Windows Form to make the game
  • Load external files to the windows form
  • Create a 3×3 grid in Windows form and load the pictures randomly.
  • Dynamically add click events to the picture boxes
  • Work with buttons, labels and timer in the game
  • use Lists, Boolean, Integers, strings and Loops in the game
  • Shuffle or randomize a list, use that list to assign pictures to the grid

 

Video Tutorial –

 

Download the Images for this tutorial
Download the Picture Matching Memory Game on GitHub

 

Full Source Code –

 

 




Comment on this tutorial and let us know how you got on -