Home

Awesome

Phaser Sublime Text Packages

This is a set of Sublime Text packages to help developers to code HTML5 2D games based on PhaserJS.

Smart coding

We use a modified version of tern_for_sublime to get JavaScript smart coding, in addition to a generated Phaser plugin using the Phaser Editor tooling.

This is a list of what you get:

  1. Phaser API auto-completion
  2. Jump to definitions
  3. Jump back
  4. Select all references (useful for renames)
  5. Describe (tested on Sublime Text 3)

For more details checkout tern_for_sublime.

WARNING: for a good code completion you should follow certain coding style, to help the type inference engine, read more about it in this issue.

Installation

  1. Install nodejs
  2. Open Sublime Text
  3. Open the Packages folder: go to Main menu > Preferences > Browse Packages...
  4. It opens the OS explorer in the package folder.
  5. In that folder copy the content of the packages directory of this repo.
  6. Restart Subilme Text
  7. Open the phaser demo project and test it coding on the game.js file.
  8. Warning: there is an issue if you add phaser.js to your project. Please, rename it to phaser.min.js until we fix it.

The demo project has nothing in special just that you should put in the root a Tern project file (.tern-project) and add there the Phaser plugin.

To enable automatic completions read here.

Thanks

Special thanks to Angelo Zerr for his very kind support on everything related to ternjs.

Found a problem?

Create an issue here!

Alternatives

Phaser Editor a complete IDE for Phaser games development.

Screenshots

Phaser API auto-completions:

completions

method help

Tern commands:

commands

Basic .tern-project file:

tern project