X

Geertjan's Blog

  • January 13, 2014

Phaser and NetBeans IDE (Part 3)

Geertjan Wielenga
Product Manager

In part 1 and part 2 I introduced Phaser a bit. Let's now set up our project so that Phaser objects such as "Sprite" can be seen in code completion, as shown below:

What you need to do is clone the Phaser sources into your project's "www/js/libs" folder. Then wait a bit for background scanning to complete, which is when the parsing is set up.

And then you can use code completion, as shown in the screenshot above (click to enlarge it). Another approach is to create a symlink to your project from the cloned Phaser sources. Yet another approach is to use a PHP project, instead of an HTML5 project, since the PHP project has an include path setting in the Project Properties dialog, where external sources can be included for editor purposes, where the "phaser/src" folder can be registered. 

The approach of using the Phaser sources actually conforms to the standard way of developing applications with Phaser, as stated here: "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." (See here.)

Join the discussion

Comments ( 6 )
  • Michael Sunday, January 26, 2014

    First method doesn't work at all for me with NB 7.4, PHP method works fine. Thanks!


  • Roberto Tuesday, February 25, 2014

    Thanks for posting about Phaser, Geertjan! I started playing with it after the first post.

    I am a Java developer by day and have worked with animations in Swing and JavaFx (as well as JavaFx Script). I have to say that the Phaser API is a nice way to write a game AND it is cross-browser and mobile friendly.

    I wrote a mini-game that is a parody of Plinko! from the daytime show The Price is Right!

    Check it out: http://www.onebeartoe.net/games/blinko/


  • Geertjan Wednesday, February 26, 2014

    Great to hear, Roberto. Nice game. Did you use NetBeans IDE for that?


  • Roberto Marquez Wednesday, February 26, 2014

    Thanks! Yes I used Netbeans IDE to develop the mini-game, as a PHP project.


  • axxion Saturday, July 19, 2014

    Hi

    im trying autocomplete like this, but not work for me,

    pls check image:

    http://i.imgur.com/rI7XOqp.jpg


  • guest Friday, August 5, 2016

    waste of time, autocompletion doesn't work in Netbeans 8.1


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.