Blast from the Past: A simple game called lights out. You can customize the number of buttons to change the difficulty. We have tested the code in IE 7.0, Firefox 2.0.0.3, Opera 9.20, Netscape 8.1.3 and AOL Explorer 1.5. This script worked well in IE 7.0, Opera 9.20 and AOL Explorer 1.5. In Netscape 8.1.3 and Firefox 2.0.0.3 it did not work correctly.
|
Depending on your knowledge of HTML and javascripts, this is an easy two (2) part copy and paste code that goes in both the <HEAD> (minimal reconfigurations) section and <BODY> (no reconfigurations) section (anywhere you want it to appear) of your document.
<HEAD> Section Reconfigurations
<script lanugage="javascript"> |
As you can notice to the left the reconfigurations are extremely minimal. Basically all you can do is configure how many little buttons in each nRows and nCols plus your alert message upon winning the game.
|
Little Extra Not Included In The Script: The last this we shall cover is to make the <HEAD> section of the script into an external.js file and called from an external location. If you need a little refresher on howto, see below.
The <HEAD> section of code starts and ends with opening and closing JavaScript tags, See below:
If you would like to see an example of this effect with the use of an external.js file in the <HEAD> section, grab the below link and you are there.
[ Lights Out Game With External.JS File ]
We hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our [ FAQ ] and if you can't find the answer there, [ contact us ].
[ Get Code Here ]
[ Rate This Page ]