DOMTRIS

I don't know how many JavaScript Tetris clones are out there, but I bet it's quite a few. Nevertheless, I decided I would have a go at it as well. This is a pretty standard, no frills Tetris game. I've tried to keep it "sort of" close to the original, so there are no extra fancy features like some of the later editions.

Clearing a line gives a certain amount of points depending on the level starting at 30 points. Clearing multiple lines gives even more points with 4 lines scoring 520 on level 1. As the level goes up, so does the speed of the falling tetrominoes. New levels begin at 500, 1000, 2000, 5000, 10000, 25000 points, etc.

The graphics, if we can call them that, are simply colored div elements. The embossed look is done with a simple CSS outset border type. I think it looks great in Firefox, Opera and Safari, but IE's borders look a bit different. That's ok, though, as I recall the appearance of these borders are not defined in the spec, so I guess IE is free to do as it pleases. It's cosmetic and not that big of a problem anyway.

You can save your progress at any time during the game by pressing "S" after which you will be presented with a URL that you can go to in order to load the saved game. What happens is that the game creates a URL to the game with a long ass querystring containing the current game state. This URL is then shortened via Tinyurl using Simon Willison's json-tinyurl service. So you get a short text string that will fit on the back of your hand, should you need to rush home from work to continue playing Tetris!

Read more...
0 comments
Post a Comment