13

THE MEMORY GAME

CHAPTER OUTLINE

The DeckArray Class

DeckArray Code

DeckArray Breakdown

The MemoryGameEvent Class

MemoryGameEvent Code

MemoryGameEvent Breakdown

The MemoryGame Class (the Game Engine)

MemoryGame Code

MemoryGame Breakdown

Sample Use of MemoryGame

Conclusion

The memory game in this chapter was originally built for a site that was targeted at children. The site itself emulated a board game that had checkpoints along the way, and there was a spinner for the users to click to determine how many spaces their game piece would move. As they passed over each checkpoint, they would be taken into one of six different secondary games. The memory game was one of the six. Since then, this same engine has been used to create a small memory ...

Get Flash Advertising now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.