Plinko!

Play

Open Plinko! (updated August 19, 2003)

Overview

This game won't work in any browser that doesn't support DHTML. You will know if it's not working. The game won't show up, and a message will be displayed, "This game requires Internet Explorer 4+ or Netscape 4+ or Mozilla". (See below for browsers that are known to work)

To play, wait for the game to load fully (If it's loading, a message in the bottom right hand corner of the board will display "...still loading..."). The rules of the game are simple. Press one of the play buttons and the chip will start dropping from that point. It will bounce it's way down and land in one of the point sections. You get five chips (the remaining chips are represented by the asterisks (*) in the lower left hand corner). Your score is accumulated for the five tries. Once you've used five chips, your game is reset the next time you hit a play button. (This will make more sense when you look at it.)

What I've learned here.

For those who are interested in writing JavaScript, here's something I learned while writing Plinko! I used to get an error when any of the play buttons was hit too early. This was caused when trying to change the "innerHTML" property of an object before the page was fully loaded. FYI, the message I got was

Could not complete the operation due to error 8000000a.

The solution to this problem is to use Internet Explorer's onreadystatechange event. What I do is put the following line of code outside of any functions so it'll occur when the page loads:

document.onreadystatechange=fnStartInit;

The function fnStartInit() looks similar to the following:

function fnStartInit()
{
    if (document.readyState=="complete")
        readyToPlay = true;
}

This boolean allows the game to start. So when the user presses a Play button, and the document's done loading, then the game can begin.

Further explanation of onreadystatechange can be obtained at http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onreadystatechange.asp

More of what I've learned here.

Update May 14, 2001: Plinko! was not working in Netscape 4.74, so I had to once again tinker to get it working. The quick fix was to move the browser variables to the main html page. Netscape was loading the JavaScript js files after triggering the onLoad event. What this means is the game works in Internet Explorer 5.0 and Netscape 4.74, but possibly not earlier 4.0 versions of Netscape. If you have any problems loading or playing the game, e-mail me.

Update August 19, 2003:
I got around to making Plinko! more of a cross platform game. I've tried it in Internet Explorer 5.0, Netscape 4.74, Netscape 6.1, Mozilla 1.2.1, and Mozilla Firebird 0.6.1. A while ago when I made this game work in IE/NS, I tested it in IE 4.72 and Netscape 4.61. I'm not sure if it still works in them.

About this page: