Skip to content

Instantly share code, notes, and snippets.

@tcql
Created September 21, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcql/6653542 to your computer and use it in GitHub Desktop.
Save tcql/6653542 to your computer and use it in GitHub Desktop.

Download

Download and unzip... wherever you feel like: Phaser Project

Install

In whatever folder you unzipped into:

npm install

In the long run, I think we could prepackage the entire project up in a zip/tar so people could just download PhaserProject.zip, and have dependencies already in the structure, so no need for npm installing

Now! The cool bits!

Running the phaser util script

There's a handy little script, phaser.js in the top level. Theoretically, if you aren't on windows, you should be able to use it by running phaser. If you're on windows (or that doesn't work for whatever reason), node phaser will work.

Creating a project

So here's what you can do:

phaser project:make MyProject

This will create a folder in projects/MyProject, with the Hello Phaser example prebuilt.

Using the test server to see examples and projects

If you want to see examples/docs/projects,

phaser serve

Now visit localhost:8000

If you go to the examples page, only the 3 animation examples have been switched over to the new setup right now.

But the cool thing is all your projects will be listed on the index page :D

Deleting a project

phaser project:delete projectname

Follow the prompt, and it'll chastise you appropriately for cruelly destroying an innocent project.

Future / Todo

Project templates

In the future, I want to make it possible for the user to create a project by specifying a template name...

phaser project:make MyProject a_custom_template_name

That way we can have a Hello Phaser template, or a super barebones empty template, or something more complex.

I've already got the basic functionality for supporting templates in, just need to make it possible to choose

Clean up the serve task

It's kind of ugly and messy

Pretty up the homepage

Obviously.

Set up pre-packaging

So we can easily make a clean zip archive of the project skeleton for releasing

A few more project: helpers

Like ways to let users package up their own project, ways to update a project to have the newest version of phaser, etc etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment