HTML 5 Canvas game
benjoffe.com
benjoffe.com
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%!
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.
So it's obviously not a deliberate tradeoff.
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.
I've tried to make it not cheesy and nice smooth gameplay
EDIT: "You have died of dysentary." That made me smile.
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.)
jd/adobe
His other demos seem to run pretty well too (using Flock): http://www.benjoffe.com/code/tools/functions3d/ http://www.benjoffe.com/code/demos/canvascape/ http://www.benjoffe.com/code/toys/spirograph/
The only thing is that pressing up and down to rotate the tetromino moved the page up and down as well.
Otherwise, pretty impressive for not using Flash.
Perhaps need to cancel default action in the key handler...