This is a small guide you can follow to start writing your games and perform common tasks related to the editor’s features.
Download and install¶
Download the Phaser Editor ZIP file of your OS (win64, linux64 or macosx) and uncompress it.
Notes for Windows users¶
To execute the editor just double click on the
Notes for MacOS users¶
To execute the editor double click on the
Phaser Editor application. It is a simple
.app folder. By default the projects will be created in the
Notes for Linux users¶
Before to run the editor you should set execution permission to some programs bundled in Phaser Editor. To do this, run the
$ cd "Phaser Editor" $ ./SetPermissions.sh
Then run the editor as any other Linux program:
Phaser Editor was tested on Ubuntu 14.04 Gnome.
Some users are getting issues at the editor startup. Please check this issue to get a workaround. Basically, the idea is to run the editor in this way:
$ ./PhaserEditor -persistState false -clearPersistedState
The first run¶
The first time you run Phaser Editor a Workspace Launcher dialog is open. In this dialog you have to set the path to the folder where you want to create the workspace.
A workspace is the container folder of your projects. All your projects will be created inside the workspace, but also, in the workspace are saved your preferences and UI state. This means, that if you start Phaser Editor and select a workspace, the editor will get the preferences saved there.
A project is a folder where you add the code of your game. So you can create many projects in the same workspace.
By default when the editor opens it checks for available updates. We recommend you to install them, important bug fixes are provided this way.
Create a project¶
In Phaser Editor there are two ways of creating a Phaser project: by using the Phaser Project wizard or the Phaser Example Project wizard.
The Phaser Example Project wizard allows the user to create a project based on the official Phaser examples (and other examples, like the Phaser Editor demos). This way is great for users who start in Phaser and want to mess around with the examples.
Phaser Project wizard¶
To create the project go to
File > New > Phaser Project. It opens a dialog where, at the first page, asks for the name of the project:
Write the name of your project and press the Next button if you want to change the project settings or press Finish to create the project with the default settings. We recommend you press Next and adjust some of the settings.
So, by pressing Next the wizard shows the settings page:
This page contains a group of parameters that affect different aspects of a project:
||Are the same parameters of the
||Contains a list of project layouts that you can select. You can select to create a project with a very simple structure or a complex, production ready structure. These layout are related with the number of Phaser states are going to be used in the game.|
||In this section you can set if you want to add some demo assets to the project. This could be good if you want to take a better idea of how a Phaser project is. In many of the layouts, when you select to add assets, some prefabs are created so it is a good way to know how prefabs work.|
After setting the parameters, press the Finish button to create the project and files.
In dependence of your layout one file or other will be open to start editing the game. Usually what is opened is a visual scene file (canvas file) so you can start adding new objects to the game.
Phaser Example Project wizard¶
In addition to the Phaser Project wizard there is the Phaser Example Project wizard, that provide a list of templates based on Phaser examples.
- Main Editor Demos: provided by Phaser Editor. We recommend to start with them since it shows some the most important features in the editor, like the scene maker and the assets manager.
- Phaser Coding Tips: contains the issues of the [official Phaser tutorials].
- Phaser Templates: contains the templates listed in the Phaser github repo.
- Phaser Examples: contains the official Phaser examples. These templates are a great resource to learn and test Phaser features, you can create a project, run it and modify it.
After you select the template you can press Finish to create a project with an auto-generated name, or click Next to change it.
The Project Explorer¶
The Project Explorer is a view with all the projects of the workspace. It is like a filesystem explorer, you can browse your projects and apply actions to the folders or files (open a file, create a folder, optimize the PNG of a folder, etc…).
A nice feature of Phaser Editor is the preview of the assets. In the Project Explorer you have two ways of preview the media files: hover the file with the mouse or select it and press
By default, Phaser Editor updates (refreshes) the Project Explorer if the workspace is changed by external programs (for example if you modify, delete or add a file in the OS explorer). However, you can refresh the Project Explorer manually if you select a resource (project, folder or file) and press F5 .
Run the game¶
To run your game there is a button in the main toolbar, it opens the default OS browser and start a built-in HTTP server to listen in a random free port. First you have to select, in the Project Explorer, the project you want to run, then press the Run Phaser Project button in the main toolbar (or press
To run your game we said that you have to select the project of your game, but really you can select any file or folder of the project, or the file of the active editor can be used to know what project to run.
Phaser Editor has a built-in HTTP server to serve the static content of the projects. The first time you run a project, the server is started and serves all the static content of the workspace. So, in the browser is open an URL like:
Phaser Editor supports Git by default. You can learn how to version projects in the EGit page .
(This section is a promotion)
If you want to learn Phaser or go deeper in it, we recommend the following Zenva Academy courses:
Advanced Game Development with Phaser: Become a Black Belt Phaser developer and create advanced games. Multiplayer included!