Getting started with Phaser

In this lesson, we get a basic Phaser project up and running.

Step One: Downloading Phaser
The official website is: http://phaser.io/

Download it by clicking on min.js on this page: http://phaser.io/download/stable

Step Two: Running a webserver
Because our game will need to load files externally, we'll need to set up a local web server to get around Javascript's filesystem limitations.

The easiest way is using Python. Make sure you have Python, if not, download it here: https://www.python.org/

Navigate to your work directory, and run (if using Python 3):

Or if you're using Python 2:

Open http://localhost:8000 to check if it worked.

Step Three: Run the template project
Copy this HTML file into your work directory:

https://gist.githubusercontent.com/OmarShehata/2b6ba3b1a391f3b876f2/raw/3620c1dfb9807b842ce3264e65e68d0b67941d7d/Phaser%2520Template.html

Make sure you have the web server working in this directory, then open the file in your browser (through the webserver). If everything worked, you should see a green box floating up and down:

Step Four: Look through the code
Make sure you understand what's happening in this basic template before moving on.

The official Phaser documentation is always helpful http://phaser.io/docs/2.4.2/Phaser.Game.html

Challenges

 * Can you make the game fullscreen?
 * Can you figure out what anchor.setTo does?
 * Can you make it go up and down faster?
 * Can you make it go left and right instead?