Concentration is a memory game you can play even without a computer, just with a deck of cards. Shuffle the cards, lay them face down on a table and at each turn choose and flip any two cards with faces up.
If they match (both cards are Aces, Twos, Threes, and so on), remove them from the table. If not, lay them face down again and pick another couple of cards. The game is completed when, due to successful matches, all cards have been removed from the table.
Concentration can be played as a solitaire or by any number of players. In this case the winner is the one who removed the most cards.
In this chapter you will create a complete Concentration game from scratch, with a step-by-step approach, learning these basics:
Creating a Flash document
Working with packages, classes, and functions
Printing text
Commenting your code
Creating and managing variables and constants
Creating and managing arrays
Generating and rounding random numbers to simulate the shuffle of a deck of cards
Repeating the execution of code a given amount of times with the
for
loopCreating Movie Clips to be added with AS3 and interacting with them on the fly
Handling mouse clicks
Dealing with timers
It's a lot of stuff, but don't worry as the whole process is easier than you can imagine.