| Webtris HTML5 demo |
|
| Wednesday, 12 August 2009 06:06 |
|
After boldly stating that HTML5 is better than Flash and Silverlight, I've spent the last couple of days putting together a game demo to learn the Javascript HTML5 methods and try to demonstrate the potential. The result is Webtris, and as the name suggests, it's a Tetris clone. It's early days, so although bland, it's fully playable and it should run fairly quickly, around 25 to 30 fps on most systems. So far it's compatible with Chromium/Chrome and FireFox 3.5 or higher. At the moment it's not working in Opera, the reason being that Opera doesn't support any of the text drawing functions of HTML5. Presumably it will at some point in the future, but for now, at least until I implement a javascript text renderer, webtris won't work on Opera. Besides Opera, Chromium, it's variants and Firefox are used by over 50% of my visitors, so most of you should be able to see it. If you are running any version of IE then you are out of luck. The game won't work for you and I have no plans to kludge one of the Javascript canvas tag implementations into it because it'll be slow and it just encourages Microsoft to continue resisting support for HTML5. Honestly, "At this stage we have more questions than answers" is completely unacceptable from such a large software company when the other browsers teams are doing such a fantastic job. No, you aren't going deaf, there are no sound effects yet. In terms of raw Javascript performance, Chromium is the winner. The only compatibility problems I had between Chrome and Firefox was in keyboard handling. Firefox can use the cursor keys to move the blocks, but I had to resort to the old standby of WASD for Chromium. I assume there's a way around this, but it'll take some research. Now that I've got an idea of how it all works, I'll start putting together some tutorials explaining how I handled the functions of the game. The commented source code for this game is available for your viewing pleasure in the HTML5 section of this website. So, click on the game window and have a go, then leave some feedback if you like.
blog comments powered by Disqus |
