Hacking away at the code on Github


#1

Greetings,

Really fun game. I’m interested in learning about the code itself and I see that it’s open source and available on Github. I’m looking at the code but I have no idea how to start understanding the project directory layout. Which file is the main file? I’ve got a Java background so I understand the basics of OOP and I’m looking to learn enough so that I can start creating my own games or adding code to existing projects on Github.


#2

Hey @HandleThatError, glad you’re checking out the code! It’s a web application, so the main file is here:

https://github.com/codecombat/codecombat/blob/master/app/assets/main.html#L57-L57

That call to initialize leads over here:

This ties into all the front-end code in the app directory. The requests to the server are all handled in the server directory, with the entry point here:

If you trace the requires, you might get a better sense of it. Now that CodeCombat is really huge, though, it might be easier to comprehend a smaller, simpler Node.js/Backbone.js project to get some of the basic server/webapp stuff straight, then look again at how CodeCombat does everything. I like some of the examples over here: http://brunch.io/examples.html

Hope this helps!


#3

Thank you very much for your time and your help! I really really appreciate it. :smiley: