JavaScript and Frames, Part II: Final Thoughts - www.docjavascript.com
JavaScript and Frames, Part II (10)
A Final Word
In this column we showed you how to write a Memory game. We based our script on frames that are cross-browser, cross-platform, and easy to program in JavaScript. We explained how the game works and how we designed the frames to support it. We went over the global variable section line by line. We taught you how to reveal, remove, and cover a card. We also explained some key decisions we took during the script programming. Loading all images into memory is one of them. In this column you learned:
- How to design the overall structure of the game using frames.
- How to set the global variables section.
- How to initialize the game board before the game.
- How to handle mouse clicks.
- How to reveal a card.
- How to remove and cover back a card.
- How to write the frames.
We also provided you with the script listing, as well as its zipped version.
Produced by Yehuda Shiran and Tomer Shiran
Created: April 5, 1999
Revised: April 5, 1999
URL: https://www.webreference.com/js/column37/final.html