A DOM-Based Snakes Game, Part I: A Final Word | 2
A DOM-Based Snakes Game, Part II (10)
A Final Word
In this column we completed our walkthrough of the Snakes game. We explained to you in detail how to build the game's DOM and then how to load its board and objects. We reminded you how to use the setInterval()
function to run the snake forever. We showed you how to move the snakes around, how to win, and how to lose. Most importantly, you now have a reference application you can always come back to and use as a source for your own exciting and attractive DOM-based applications. In this column you learned:
- How to build the game's DOM
- How to load the game's board
- How to load the game's objects
- How to interact with the users
- How to move the snake
- How to handle collisions with the border and with itself
- How to win points in the game
We also included the game's complete listing and its zipped version as well.
Produced by Yehuda Shiran and Tomer Shiran
Created: August 30, 1999
Revised: August 30, 1999
URL: https://www.webreference.com/js/column47/final.html
URL: https://www.webreference.com/js/column47/final.html