Step 9: Try Other Features

To learn more, try changing icons and colors, adding a game timer, and adding sounds. To make the game more challenging, try making the board bigger and adjusting the timer.

To download a completed version of the sample, see Complete Matching Game tutorial sample.

To try other features

  • Replace the icons and colors with ones you choose.

    Tip Tip

    Try looking at the label's Forecolor property.

  • Add a game timer that tracks how long it takes for the player to win.

    Tip Tip

    To do this, you can add a label to display the elapsed time on the form above the TableLayoutPanel, and add another timer to the form to track the time. Use code to start the timer when the player starts the game, and stop the timer after they match the last two icons.

  • Add a sound when the player finds a match, another sound when the player uncovers two icons that don't match, and a third sound when the program hides the icons again.

    Tip Tip

    To play sounds, you can use the System.media namespace. See Play Sounds in Windows Forms App (C# .NET) or How To Play Audio In Visual Basic for more information.

  • Make the game more difficult by making the board bigger.

    Tip Tip

    You'll need to do more than just add rows and columns to the TableLayoutPanel – you'll also need to consider the number of icons you create.

  • Make the game more challenging by hiding the first icon if the player is too slow to respond and doesn't choose the second icon before a certain amount of time.

To continue or review

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft