Jump to content

How to use the dev.html file?


Ninjadoodle
 Share

Recommended Posts

Hi guys

 

I've recently read that the dev.html file should be used for development and the index.html for deployment.

 

I am completely confused on how to use the files :(

 

I don't use NPM and instead use Mongoose as a web server.

 

I assume I need to minimise my files, in order to do things the recommended way.

 

Could someone please give me a quick rundown of how I should use these files and minimise my Panda games?

 

Thank you in advance!

Link to comment
Share on other sites

Hi

 

First of all, you will need NPM because Pandatool uses Node.js, and that is used to build your game.

 

That gave me an idea, that maybe i should make a standalone application of Pandatool... hmm.

It would be cool to have one application that manages all your Panda projects, and you could

open your project, update version, check your code style, and build it with one click.

There could even be code editor inside that application.

Link to comment
Share on other sites

Hi @enpu

 

I've installed Node.js, then panda tool and panda.js

 

I've run the dev.html and everything seems to work fine, I do have a couple of questions tho.

 

I can't seem to find any info on how to actually build a minified game using the index.html. 

 

If anyone can help, that would be awesome :)

 

Thanks in advance!

Link to comment
Share on other sites

Hi @enpu

 

Thank you for the quick reply :)

 

If I use 'panda build', then I do get a minified file, but when I click index.html nothing loads. If I click the dev file, things load normally.

 

Just out of interest - is using Pandatool, the only way to minimise a Panda game, or is there a way to do this without node.js?

 

Thanks again!

Link to comment
Share on other sites

That's weird, do you get any errors in console?

Does your index.html load game.min.js file?

Can you try with clean Panda install?

 

At the moment, Pandatool is the only way to build, but i'm thinking of making an desktop app of it, so you won't need to install anything other (like node).

Link to comment
Share on other sites

Desktop tool sounds awesome!

 

I tried with a clean / empty install and I get the standard black screen for both dev and index after minifying ( so it works ).

 

In my actual game, the dev works ... but the index.html doesn't and this is the error I get ...

 

[Error] 0

global code (game.min.js, line 2)
Link to comment
Share on other sites

Haha, sorry to be difficult! I just sent the file through to your email :)

 

I used the fader.js plugin in the version with the error, I pasted it into the screen folder /plugins.

 

Would this somehow effect the minimise process? (again the dev works fine)

 

Thank you heaps for your help!

Link to comment
Share on other sites

So this was caused by me leaving a site lock defined not realising that it is ignored by dev.html, but not by the final minified game.

 

Thank you @enpu for finding it!

 

I do have a new error tho ...

 

[Error] TypeError: undefined is not a constructor (evaluating 'new game.Fader({color:16777215,speed:500})')

init (game.min.js, line 11)
t (game.min.js, line 2)
setSceneNow (game.min.js, line 10)
setScene (game.min.js, line 10)
setScene (game.min.js, line 2)
ready (game.min.js, line 2)
update (game.min.js, line 2)
run (game.min.js, line 2)
(anonymous function) (game.min.js, line 2)
a (game.min.js, line 2)
 
Not really sure what this means :(
Link to comment
Share on other sites

  • 3 months later...

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...