V8 JavaScript Engine
http://code.google.com/p/v8/
"V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors." (emphasis added)
The Canvas Element
http://www.whatwg.org/specs/web-apps/current-work/#the-canvas-element
Now, implementing the whole thing would be bat-shit crazy. For being usable for games only a small subset is required:
The Img Element
http://www.whatwg.org/specs/web-apps/current-work/#the-img-element
PNG is the only format one needs. Well, TGA would be easier, but that doesn't work in a browser.
The Audio Element
http://www.whatwg.org/specs/web-apps/current-work/#audio
Since MP3 doesn't easily loop without gaps, Ogg/Vorbis is the only sane choice.
Events
Img and audio should fire events. Apparently keyboard and mouse events would be also helpful.
Well...
That's the basic idea. Something like that would allow everyone with a good browser to write some simple games. There also isn't a compile step involved. So, the turn-over rate is pretty excellent. Additionally, everyone can quickly test the game right away in their browser without having to put it on their Wiz first. This also means you might be able to make some extra money through advertising (with the web version - well, in theory), which makes it easier to justify spending time on this stuff.
The V8 engine is pretty amazing. It's about as fast as JS can be these days. It's quite a lot faster than all those Python interpreters for example. Given that there is no bloody DOM manipulation involved, the performance should be reasonable good. Well, not awesome, but on par with the better emulators, I'd say. V8 does generate native code after all.
http://code.google.com/p/v8/
"V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors." (emphasis added)
The Canvas Element
http://www.whatwg.org/specs/web-apps/current-work/#the-canvas-element
Now, implementing the whole thing would be bat-shit crazy. For being usable for games only a small subset is required:
- the state stack
- transformations
- compositing: always source-over
- colors & styles: only needs solid fill (context.fillStyle='#abc' or '#aabbcc' - no constants)
- simple shapes (rectangles): only fillRect
- images: all 3 methods, first parameter is always an image, if possible the draw texture extension should be used to speed things up
The Img Element
http://www.whatwg.org/specs/web-apps/current-work/#the-img-element
PNG is the only format one needs. Well, TGA would be easier, but that doesn't work in a browser.
The Audio Element
http://www.whatwg.org/specs/web-apps/current-work/#audio
Since MP3 doesn't easily loop without gaps, Ogg/Vorbis is the only sane choice.
Events
Img and audio should fire events. Apparently keyboard and mouse events would be also helpful.
Well...
That's the basic idea. Something like that would allow everyone with a good browser to write some simple games. There also isn't a compile step involved. So, the turn-over rate is pretty excellent. Additionally, everyone can quickly test the game right away in their browser without having to put it on their Wiz first. This also means you might be able to make some extra money through advertising (with the web version - well, in theory), which makes it easier to justify spending time on this stuff.
The V8 engine is pretty amazing. It's about as fast as JS can be these days. It's quite a lot faster than all those Python interpreters for example. Given that there is no bloody DOM manipulation involved, the performance should be reasonable good. Well, not awesome, but on par with the better emulators, I'd say. V8 does generate native code after all.