For the last couple months I’ve been working on a “how doable is it” project —
it’s a complete 3D shooter in Javascript — but where every piece of it — every
pixel in every texture, every tangent space, every polygon, and even every
sound — is dynamically generated.
I have an early alpha. You need a very modern browser to run it (FF, Chrome,
Safari do it best.) It takes a while to start up (it’s building light maps,
mostly) but it should run well. You can see it here, all the code is up on
Github.
http://www.klinksoftware.com/ws/ <http://www.klinksoftware.com/ws/>
Take a look, because it demonstrates my requests. I know my requests are very
programmer-y but I thought I’d thrown them out there.
Request 1: Add a System module, and one call I need System.gc();
Why: My game works in two parts; one part creates all the content, and then the
second part plays it. In the second part, I do as much as I can to
precreate/re-use any objects or arrays I need, to reduce GC. On the creation
part, I don’t as much. So being able to force a GC at a point helps me,
because it stops the creation part from forcing a pause in the game part.
Cons: Could be mis-used. GC would have to pause execution. Need modules to be
implemented.
Request 2: Add hints to classes.
Why: Modern Javascript engines usually use different strategies for running
code depending on certain events — for instance, function x has been run too
many times. I’d like a hint to say “always uses the best method.” Or at the
module level, though that might already happen.
Cons: Again, mis-use, and really technical.
Request 3: Static consts in classes
Why/Cons: I’m sure this has already been discussed :)
I’m pretty happy with what I’ve been able to accomplish, so I don’t have many
complaints, other than the major browser makers need to implement modules.
[>] Brian
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss