i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

Yea um, so... I added sound to YUI Tetris

Thanks to Scott Schiller and his dandy Sound Manager (from ages ago) which allows you to embed audio into your webpage and fire them at will with JavaScript. Sounded simple enough so I dropped in the soundmanager.js file, a .swf, and then an xml file to define my sounds... then Voila! it was a piece of cake. It was as easy as dropping in the appropriate triggers in particular points of my tetris script such as moveLeft, moveRight, drop, nukeLines or rotate. I experienced first hand the benefits of writing in Object Notation when I had to go back and do some editing...

So really, you added sound!!??

Before I get hosh posh from the purist who will have liked it better without the cheesy sound effects, I just want to let everyone know... I was just having fun. And for those who barked and moaned the first time about my choice of keys to use for controlling the blocks; I had a perfectly good explanation of those, and that is that it is a mirror of the original Nintendo layout. Left hand on the directional pad (s | d | f). And your right hand on the A & B buttons (for rotating (and yes, you can rotate both directions in the original tetris!!)). In all seriousness, please don't continue to comment on the keys. It's literally a matter of changing like 3 lines of code.

One final sidenote

This is NOT Ajax. Sorry to disappoint. It's a video game with animation and sounds. There is not a single instance of xmlHttpRequest in all of the code.

Now enjoy the mario bros music while playing tetris ;)

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.