4 ms·
> We're there again: take 3 lines of JavaScript and you're drawing an image to a canvas element. Take 20 more lines and you have a rendering loop and a sprite t
by debacle 14y ago
> We're there again: take 3 lines of JavaScript and you're drawing an image to a canvas element. Take 20 more lines and you have a rendering loop and a sprite that moves with the arrow keys.
Processing (Java), PyGame (Python), and I'm sure many other libraries can do the same thing. They're also faster, cleaner, more robust, and you're not writing some insane garbled blend of JavaScript and GLSL with all the associated scaffolding code between the two vastly differently typed languages.
I would highly recommend Processing for any graphics playing that you might do. Yes, you have to write a bit more code (it is Java, after all), but it's also much more rewarding and just as portable as something written for WebGL.
- DanI-S 14y agoNot to knock Processing, but I don't see how it can be described as 'just as portable' when a WebGL-capable interpreter is already installed on millions of machines worldwide, with zero knowledge required to use it?
- swang 14y agoThose libraries/languages don't have the user install base of javascript, which is nearly every single piece of computing that has been released in the last 10 years, albeit most of those older models probably won't be able to run the javascript that's running now. And there is no "click download" required like those two libraries would need and also no need for patch updates. Your "download" is just pointing to a URL.
- TazeTSchnitzel 14y agoI find it amusing that you mention Pygame, because it's a wreck with horrible performance due to software rendering, it has bad tutorials, inadequate documentation, and last time I checked had 32-bit/64-bit issues. Source: Personal experience porting a multiplayer 2D game Edit: By contrast, JavaScript (well, CoffeeScript) and the DOM was a much nicer experience.
- postfuturist 14y agoNot only that, but Pygame only runs on CPython, which is about 10X slower than the JavaScript engines in FF or Chrome.