super001 Posted August 21, 2014 Share Posted August 21, 2014 hi, I just started using Phaser. it's awesome, really easy to learn and use. I was wondering how to set up a project. I know there are many ways: the easy one is to have a index.html file, a .js file and the phaser.min.js. I'm currently making a game but the .js file has reached 300 lines of code, that is not a good thing as it could be a bit counfusing, expecially for someone who wants to contribute. so my question is how can I set up a Phaser projects making it easy understandable? P.S. I need i detailed guide/explanation if possible thanks a lot. Link to comment Share on other sites More sharing options...
lewster32 Posted August 21, 2014 Share Posted August 21, 2014 There're some nicely laid out templates here: https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates Splitting your JavaScript up into separate files can be as simple as doing just that; copying and pasting the bits into different files, then just adding more script tags to your html file. Later on you may want to concatenate them and minify into a single file and at that point you should probably start looking at build tools like Grunt or Gulp, though they're not for absolute beginners. If you do work these tool out though, they make the whole process much nicer; you can have them watch your files for changes, and when you alter any of your separate files, they can check for errors, combine, minify and even do stuff like generate documentation - and much more. It's the tip of a pretty big iceberg and I don't think any one tutorial or guide could (or should) cover it all, and each person will find their own way and their own preferences for coding style, tools and so on. It's a lot of fun and very rewarding to learn though, so good luck, get your hands dirty and by all means ask questions here if you get truly stuck super001 and esteban.guelvenzu 2 Link to comment Share on other sites More sharing options...
robomatix Posted August 22, 2014 Share Posted August 22, 2014 I recommend you to read this : http://www.codevinsky.com/phaser-tutorial-getting-started-with-generator-phaser-official/ and this : http://www.codevinsky.com/phaser-2-0-tutorial-flappy-bird-part-1/. These help me a lot... super001 1 Link to comment Share on other sites More sharing options...
crysfel Posted August 22, 2014 Share Posted August 22, 2014 Yeah, phaser-official is great! is easy to create prefabs and states. Link to comment Share on other sites More sharing options...
Recommended Posts