Jump to content


Photo
- - - - -

[Newbiew Question] To what extends I can keep using phaser.min.js?

import js phaser

Best Answer rich , 19 December 2013 - 04:45 PM

You should include phaser.min.js in your html when you deploy the final, finished version of your game.

 

Until that point you should use phaser.js (the non-minified version) as you'll get accurate debugging / line numbers from it should something die internally.

 

You only really need to use the src files if you are:

 

1) Hacking around the library (which I totally encourage btw!)

2) Trying to fix a Phaser bug or track-down a Phaser specific error

3) Wanting to understand how the code works better.

 

The reason the examples use the raw source files is because we use them as a form of unit test, and are constantly testing new features in the library, and it'd be a pain to have to rebuild the phaser.js file every single time just to do this. So usually we only do that when we release a new version.

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 notalentgeek

notalentgeek

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 19 December 2013 - 03:11 PM

I have downloaded Phaser from github and I saw all the examples and tutorials there are using phaser.min.js or phaser-example.js. However I saw in the src folder there are a ton of js files.

 

My question are to what extend I can keep using phaser.min.js?

And when it is necessary to import those js files from src folder?

 

I am sorry if this obvious question. I am new to js and just moved from flixel. :) I would be grateful if someone would like to explain me. :D



#2 rich

rich

    Administrator

  • Administrators
  • 4209 posts
  • twitter:photonstorm
  • LocationUK

Posted 19 December 2013 - 04:45 PM   Best Answer

You should include phaser.min.js in your html when you deploy the final, finished version of your game.

 

Until that point you should use phaser.js (the non-minified version) as you'll get accurate debugging / line numbers from it should something die internally.

 

You only really need to use the src files if you are:

 

1) Hacking around the library (which I totally encourage btw!)

2) Trying to fix a Phaser bug or track-down a Phaser specific error

3) Wanting to understand how the code works better.

 

The reason the examples use the raw source files is because we use them as a form of unit test, and are constantly testing new features in the library, and it'd be a pain to have to rebuild the phaser.js file every single time just to do this. So usually we only do that when we release a new version.


  • Mike and notalentgeek like this

phaser-header.png

 

phaser docshttp://www.photonstorm.com | "Quality is a great business plan. Period." - John Lasseter, Pixar


#3 Mike

Mike

    Advanced Member

  • Moderators
  • 361 posts
  • twitter:MikeMnd
  • LocationSofia, Bulgaria

Posted 19 December 2013 - 10:21 PM

Rich, this answer is a for FAQ page or somewhere there. Although a knew it from long ago, it's synthesized very good! :)


"The Great Man Is He That Does Not Lose His Child's Heart."





Also tagged with one or more of these keywords: import, js, phaser

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users