Ninjadoodle Posted February 11, 2015 Share Posted February 11, 2015 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! Quote Link to comment Share on other sites More sharing options...
enpu Posted February 11, 2015 Share Posted February 11, 2015 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 couldopen your project, update version, check your code style, and build it with one click.There could even be code editor inside that application. goide and 7Game 2 Quote Link to comment Share on other sites More sharing options...
enpu Posted February 11, 2015 Share Posted February 11, 2015 But for now i would recommend you to install Node: http://nodejs.org/ Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 11, 2015 Author Share Posted February 11, 2015 Hi @enpu Thank you for the tips! I will give it a go and see if I can get it to work Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 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! Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2015 Share Posted February 18, 2015 Just run 'panda build' in your terminal (on your project folder). Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 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! Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2015 Share Posted February 18, 2015 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). Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 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] 0global code (game.min.js, line 2) Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2015 Share Posted February 18, 2015 Well that's a nice error! Can you send your game.min.js so i can take a look? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 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! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 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 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 18, 2015 Author Share Posted February 18, 2015 Thanks again @enpu Second error was caused by me loading the fader plugin in the html file instead of requiring it in the main.js file like the others. Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2015 Share Posted February 18, 2015 No problem! Quote Link to comment Share on other sites More sharing options...
goide Posted May 28, 2015 Share Posted May 28, 2015 @ninjadoodle How run the dev.html? before using this command in the terminal panda serverUpdate Panda Toolkit its version 1.12.3 and now that instruction does not work me. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 28, 2015 Author Share Posted May 28, 2015 Hi @goide I'm currently using the 2.0 dev version because I don't want to change too much code when it comes out I use -> http-server -o (opens a browser window after running the server) Quote Link to comment Share on other sites More sharing options...
goide Posted May 29, 2015 Share Posted May 29, 2015 @ninjadoodle Thanks men. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.