rblopes / generator-phaser-plus

[🛑 DISCONTINUED] It has been a long journey but development of `generator-phaser-plus` is now over. I recommend you have a look and fork `yandeu/phaser-project-template` instead.
https://github.com/yandeu/phaser-project-template
MIT License
144 stars 14 forks source link

Added an example of how to use a Plugin. #20

Closed JarLowrey closed 7 years ago

JarLowrey commented 7 years ago

Saves devs precious googling time.

rblopes commented 7 years ago

Hi, @JTronLabs. I greatly appreciate contributions, however I'll have to decline yours this time for a few reasons.

First, the same tip is already commented in the Preload.js state, which I believe is a more convenient place for initializing Phaser plugins. They could go anywhere in the code of course, however some plugins may depend on static assets that should be copied and included using the assets.js module or using regular Phaser.Loader methods.

Also, we shouldn't encourage people editing package.json to add packages. Instead, always use npm install --save <package-name> to install packages and update the package manifest at the same time. Unfortunately, not all offered Phaser plugins are available through npm.

Now, I'm aware the whole source of confusion here (and in the template) is the lack of documentation, but that should be fixed shortly. Only reason I'm delaying the next release now is because I couldn't make it before Ludum Dare 36, happening this weekend. If all comes well, a new release of the generator will be published this September. :+1:

JarLowrey commented 7 years ago

@rblopes Thanks for looking it over and responding. I feel silly that I missed the Preload comments, but I'm glad it's already there to help others. You make a good point about moving plugins over to Preload as well. Ditto for npm install --save <package-name>, I didn't know it updated package.json.

Thanks for the great generator! Awhile back I contributed to @julien's generator, trying to add some additional sub-generators. Both good solutions, but I appreciate how this one has so many good comments and modularity (e.g. the assets.js file is bomb).

Good work! And thanks for maintaining it!