I'm just starting out as a game developer and have created a few crappy but playable clones of classic games like pong, and bomberman. Being self taught (bless the internet) I do this by just stuffing in code to make the games work.

Now I feel the time has come to create something complete, for this I need to know how a game is structured. I've searched on the web but there isn't that much to be found. The only "high-level" language I know is javascript so reading a tutorial or article based on C++ doesn't help me that much.

I'm looking for good resource's pedagogically covering the theory and possibly examples (in Javascript or pseudo code that is understandable for a beginner) of how the game pieces fit together.

From the start screen to asset loading and running the game loop. I'm not looking for anything complicated like reading through a 4000 line source code. All I want to learn is where, how and when the main parts of every game should be called.

If you know any good resources to share, or maybe even have an answer for me I would deeply appreciate it.

  • \$\begingroup\$ Games are structured in many different ways depending on your needs, your tech, and your personal coding style. And the best way to optimize is to profile what you already have. This question isn't really answerable. \$\endgroup\$ – Tetrad Apr 2 '12 at 7:18
  • \$\begingroup\$ Did you even read the whole post? "I'm looking for good resource's pedagogically covering the theory" how is that not an answerable question? a link would be enough... \$\endgroup\$ – justanotherhobbyist Apr 2 '12 at 7:22
  • 3
    \$\begingroup\$ Hasty to close this IMO. There is plenty of advice to be given about creating good event loops plus plenty of advice on creating optimal and efficient JavaScript. \$\endgroup\$ – Tim Holt Apr 2 '12 at 7:36
  • 1
    \$\begingroup\$ That's not actually comparable, asp.net has alot of information available, and has been around for a while. Whereas HTML5 in game-developement is pretty much newborn. And information is difficult to find. Also the question you linked asked for BEST practices, I'm just asking for some basic GOOD practices. And the specific problem: The missing information about HTML5 games. I could find alot of questions that are broader than this subject that are left open and have several votes. And atleast 3 people agree with me. \$\endgroup\$ – justanotherhobbyist Apr 2 '12 at 20:28
  • 1
    \$\begingroup\$ If you have a question about the main game loop in an HTML5 game, ask that question. If you want to know how to load assets, ask that question. Same thing for a "start screen". Or how to profile an HTML5 game. Or how to optimize a specific set of functionality. But bundling it all together and asking "tell me how everything all sticks together", I think, is a bad question because it isn't specific enough. \$\endgroup\$ – Tetrad Apr 2 '12 at 23:15