

Js Game Wiki - chorola
https://github.com/DaRaFF/jsgamewiki

======
pachydermic
Awesome!

For as popular as JS is, I've found it pretty difficult to find good tutorials
and resources online for it. I guess I was looking in the wrong places? Google
was just failing? My google-fu isn't as good as I think it is? I dunno...

I think this will be a big help and a good resource, so thanks a million.

~~~
ufo
Do you mean JS the language or game programming in particular? If its just the
language then there are is a bunch of good material I could recommend you (and
everyone should at least read Javascript the Good Parts even if you dont agree
with everything it says)

~~~
pachydermic
I am lucky enough to have a "Safari books" subscription from my employer, so I
have been able to look at some books - I know that one's supposed to be
seminal, but I haven't gotten around to it yet. Any other recommendations are
welcome.

Because I've just started messing with javascript, I'm mostly focused on games
programming. But more generally, it seems hard to find information about how
to write well optimized javascript (especially in terms of memory usage). This
could be _my_ problem, though. I get confused by callbacks and knowing when
I'm creating objects (especially functions) versus when I'm reusing them.
Callbacks are just confusing the hell out of me - specifically inside of
something like requestAnimationFrame... how do I prevent new functions from
being created every time I use it?

I mean, w3schools is awful for anything but a _very_ quick reference, and
while the content on MDN seems to be accurate, it's not very exhaustive and
doesn't seem to provide much explanation. Whenever I have a problem with
matlab or perl I can go to some great websites or just google my problem to
find solutions (and often great explanations) quickly.

~~~
cheapsteak
Could you elaborate on the problem you're having with callbacks and
requestAnimationFrame?

I initially posted this, but now I'm not sure if this is what you meant:

Don't do this:

    
    
        requestAnimationFrame(function () { 
            //a new instance of this function is created every time
        })
    

do this:

    
    
        var efficientFunc = function () {
            //this is created only once and is reused
            requestAnimationFrame(efficientFunc);
        }
        requestAnimationFrame(efficientFunc);  
    

Basically avoid writing anonymous functions for callbacks that are going to be
callback-ed more than once.

Another thing that might help with memory is make sure you don't keep
references to things you want garbage-collected.

E.g. if object `A` has a reference to object `B`, `B`'s memory won't be freed
even if you never use it again. MDN has a better explanation and example [1]

As for books I'd recommend Effective Javascript by David Herman.

[1]: [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Memo...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Memory_Management?redirectlocale=en-
US&redirectslug=JavaScript%2FMemory_Management#Garbage_collection)

~~~
pachydermic
Yeah I'm still stuck. Not really sure if it's a problem with
requestAnimationFrame anymore, though.

If you're so inclined, I'd appreciate if you'd take a look at my stack
overflow question.

[http://stackoverflow.com/questions/18603962/javascript-
memor...](http://stackoverflow.com/questions/18603962/javascript-memory-
management-requestanimationframe-callback)

At this point, I'm either fundamentally screwed up in my design or have some
small innocuous looking thing which is eating all of my memory.

------
AndyKelley
See also Game Modules Wiki[1]

[1]: [https://github.com/hughsk/game-
modules/wiki/Modules](https://github.com/hughsk/game-modules/wiki/Modules)

------
austinhallock
Also [http://html5gameengine.com](http://html5gameengine.com) if you're
looking for a list of engines. It's limited to the more popular, actively
maintained engines and has reviews, links, etc... for each.

------
TrainedMonkey
Could be better, but few things are perfect. Nice to have all of that info
compiled in one place without tons of ads. Now add more detailed descriptions
to each of links and organize them in beginner/intermediate/advanced/expert
categories. This way a newbie won't be completely lost and pro's won't lose
interest by opening first few links that are easy. More ambitious project
would be to add some kind of series of links/tutorials so that people who want
to learn will have a decent way of tracking their progress.

------
Kiro
You're missing one of the most vital things: game engines.

------
FreezerburnV
I was actually just looking for some stuff about Javascript game development.
(specifically looking for three.js, which I'd forgotten the name of) So this
is kind of wonderful timing to have this pop up.

It looks like a wonderful hub of all sorts of information about game
development, good job to the person who put this together! Hopefully I can
even apply the lessons I learn from all of this generally to other languages
as well.

------
CmonDev
Not an ideal name choice: JavaScript is used in some mainstream non-web
engines e.g. Unity 3D.

~~~
jamesgeck0
What Unity3D has is Javascript in name only. The syntax looks kind of
familiar, but UnityScript is more like Boo with a C-like syntax.

[http://wiki.unity3d.com/index.php/UnityScript_versus_JavaScr...](http://wiki.unity3d.com/index.php/UnityScript_versus_JavaScript)

------
alexatkeplar
Nice! You're missing analytics - Google Analytics, Snowplow, MixPanel etc

