How cocooon work out my project folders?


I start to use cocoon and phaser by following the step by step guide to create project. I downloaded the created zip code, and realise that the template project has three folders:

Does it mean I can’t create extra folders? for example folder js and css? or then need to be subfolders under src?



You can add extra folders if you need to, but you are thinking about it the wrong way. Cocoon won’t use things you don’t tell it to use, i.e. it would ignore those 3 folders on its own. Nothing in the project is loaded ‘automatically’.

As you would with a browser-based project, include script tags for any code files you add (whether they are in new folders or not) to index.html. Any files/folders you create need to be in the same folder as index.html, or a subfolder of such a folder.

The same is true of images and sounds, but these you’ll load via Phaser, and you can find examples of how to do it in src/Preloader.js