Jump to content

Compressing/obfuscating/minifying Phaser game?


Gods
 Share

Recommended Posts

A phaser game has a html, css and normally multiple js files along with images and sound.

IMG folder

Audio folder

index.html
style.css
Preloader.js
Boot.js
Game.js
 

Do you guys compress the images and audio files too?

 

Whats the simplest and fastest way you guys compress all these files? 

I am hoping a single command line to do it all :)

It seems Phaser comes with a Gruntfile.js file but how do I use it and what does it do?

Link to comment
Share on other sites

UglifyJS is a good JS minifier. Combining that with browserify or webpack could be useful to concat all your files into one file. Or just, literally, concat your files yourself before running through Uglify.

 

Yes, it's possible to optimize images as well -- check out png crush. Or stick all your sprites into sprite atlases as possible (but watch the image size if going for mobile).

 

All of these things can be done from the command line with some shell scripting, Grunt, gulp, or even Makefiles.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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