The first thing I notice is that unlike 90%+ of real-time browser-based games (flash or javascript), it doesn't stupidly burn 100% CPU for no reason at all. It takes close to 0%!
You'd probably get the same if you wrote a slow paced, event based game in Flash. Dirty rects means that even though Flash rendering is called at x fps, it can be skipped if nothing's changed (at least, as far as I understand it, my games always change each frame).
Generally if a game has focus it should burn 100% CPU in order to update as smoothly as possible, but the real problem is games that still update and consume CPU like that when not in focus.
But most of those games that burn 100% CPU still burn 100% CPU even if the game is paused with a static pause screen and the container window is scrolled past the flash area and the browser window doesn't have focus and is totally obscured.
Wow, that's one of the first JavaScript games that played just like a normal game, and it didn't feel cheesy like pong. No speed or control issues to report. Bright, clear, 3D rendering.
Of course, I, like many others, am biased for Tetris.
Oh, and I realized that you got to skip the conditions for turning at the walls, since it wraps around instead. Still hard, I bet.
Same thing happens when you die sometimes, which is a real pain. It's on my list of things to do, I'm just trying to think of a good way to handle it (gameplay wise)
Not only is it technically impressive, it's actually fun too! I'm not a gamer (not even much of a casual gamer) so this may sound like a dumb Q: but are such variations of Tetris common?
It took me a while to realize that my default browser, Safari 3.2.1, doesn't support HTML 5 Canvas. I'm seeing a bowl and a logo. Graceful degradation, not so much.
You're definitely right. I'm not so familiar with Canvas at all, so I assumed that since it didn't render, it wasn't supported. My main point was about the graceful degradation.
People speak in binary on support for CANVAS, SVG, CSS etc -- "this browser has CANVAS support", "that browser doesn't have CANVAS support".
They should actually be speaking of "what level of CANVAS support", because there are different implementations among different browser brands, versions, and possibly operating systems. Whenever there's a common spec with multiple implementations, some solid conformance testing is vital before starting development.
(I'm not too concerned about the lack of "graceful degradation" here, because it's more of an enthusiast piece, "look what I can code", rather than something solid to deploy out to the general public. Different priorities.)
hmm.. Can you see anyone else's name on their though? I see my name on Traditional - but the other 2 spots on that are blank - and all 3 spots on Time Attack and Garbage are saying "Empty"
This is great, but why Canvas? SVG/VML would be a more natural choice - JavaScript fits better with a DOM-based API where you don't have to repaint everything.
Only issue I had is if the window is sized too small to require a scrollbar, then pressing down/up actually scrolls the page, as well as controlling the game.
Perhaps need to cancel default action in the key handler...
The first thing I notice is that unlike 90%+ of real-time browser-based games (flash or javascript), it doesn't stupidly burn 100% CPU for no reason at all. It takes close to 0%!