Jump to content

HTML5 Game directory structure


Cryptonomicon
 Share

Recommended Posts

Ancient old coder new to HTML5 games so aplogies of this is obvious

 

Normally when coding a website I would put my common code - jquery, less etc all under a common url and refer to them from a collection of pages that live in their own directories. Mainly to cut down on duplicates.

 

root

|

-- core

           css

           js

           img

-- dir 1

        css

        js

        img

-- dir 2

        css

        js

        img

 

 

etc

 

Now for a game - in particular something that I will eventually want to bundle up with cocoon.js  does it make sense to have the common code for a collection of games in a common location.

 

Or should I think about keeping each game totally seperate - with duplication of assets?

 

--game 1

        css

        js

          phaser.js

        img

--game 2

        css

        js

         phaser.js

        img

 

Or does cocoon just pull whatever it needs from wherever and bundles it anyway?

 

 

Link to comment
Share on other sites

To answer my own question it turns out that no matter how I do it coccon.js likes the javascript in one contiguous file.

 

So the answer seems to be it doesn't really matter provided that the javascript is concatenated - using grunt perhaps - when it

is all done.

 

In other words use whatever you want as it suits your workflow.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...