Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Those 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.


Yes, thank you. I know how browsers work.


So you just momentarily forgot it when writing your previous comment?


Not 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?


I 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.


Not only that, but Pygame only runs on CPython, which is about 10X slower than the JavaScript engines in FF or Chrome.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: