First Impressions: Prototype 1.6/Scriptaculous 1.8
I’ve spent roughly a day creating a javascript same game clone to see about changes in the latest versions of my favorite front end scripting libraries. It uses the latest versions with no added toppings so it gives us a very good idea of what comes in the package itself. The same game code is 179 lines of Javascript, essentially just a single class that handles everything.
The results are pleasing to say the least.
PROS
- Prototype much more stable than 1.5
- Prototype slightly faster than 1.5
- select > getElementsBySelector
- automatic event binding is an awesome addition
CONS
- dom:loaded custom event failed to fire in IE6 so I had to rever to ‘load’ event instead - UPDATE: dom:loaded does work in IE6 but you should observe the event on document instead of window (thanks Tobie)
- playing the same sound repeatedly embeds a new object every time rather than reusing what’s already present. This can cause huge slow downs when you play the same sound over 100 times on a page.
- first time a sound is played it might take a while to download causing a delay - I’m thinking something could be done to fix the re-embedding all while adding a preloader at the same time
Comments on Same Game are welcome. If any other front end enthusiast see any improvements I’d gladly hear from you (use contact form).

on November 9th, 2007 at 7:17 pm
What a slick implementation Gary, congrats!
sound.js has just been added to script.aculo.us and patches are more than welcomed. I think your suggestions sounds like a nice addition.
Regarding dom:loaded I’m a bit surprised it didn’t work for you as the unit tests for it work fine in IE6. Would you mind opening a ticket with a failing test case for it ? It could be doctype related.
on November 10th, 2007 at 1:34 am
Hi Gary
Congrats on the game… but seriously: “I can’t believe it’s not flash?”
Javascript has come a *long* way recently (yay!), but I think that it’s a mistake to try and shoehorn either it or flash into a role for which it isn’t suited. A flash implementation would have taken less time to develop, wouldn’t have suffered from the drawbacks you mention (particularly compatibility with that POS IE6) and would have allowed an infinitely richer interface.
I know that this is beside the point - that you built it just to roadtest the latest versions of prototype and scriptaculous - but I have to say that I’m sometimes worried by the lengths people will go to reproduce the behviour in one that should by rights belong to the other.
Otherwise great job!
on November 10th, 2007 at 2:27 am
Nice! However, being fairly color blind I cannot tell a few of the colors apart. You need a grey scale option. ;)
on November 11th, 2007 at 4:58 am
Nice game! It has been sitting in a FF tab since it was linked by Ajaxian. How about implementing some sort of highscores table? Give us at least the top 10, please :-)
More important, thanks for the review of the sound library. I was considering to use it in a project of mine but I won’t, because of the re-embedding bug/feature. I’ll probably look at SoundManager instead and keep an eye on how the work on sound.js goes on.
on November 12th, 2007 at 12:54 am
Hey that’s a pretty fun game! And it also runs really smoothly, good job Gary
on November 12th, 2007 at 4:29 am
It’s funny,but ‘looks like we have an error’.
on November 12th, 2007 at 3:32 pm
Kuhan,
The application was tested in IE6, Firefox, Safari 2/3 and Opera. Which browser are you using?