generator-phaser

A yeoman generator for phaser games

Github星跟踪图

generator-phaser

A Yeoman generator to create HTML5 games with Phaser. This generator allows for the creation of Phaser games with best practices. The main generator (yo phaser) outputs a basic Phaser game. You can also generate new prefabs (yo phaser:prefab) or states (yo phaser:state) to add to your project.

You can view your game in the browser by running npm start from the project's root directory and the web page will refresh as you save your files.

When you are ready to publish, build your game with npm run build and view the output in the build/ folder. The build process minifies and compresses individual files into one file for faster network downloading, the source code is transpiled to ES5 compatible JavaScript using Babel.

INSTRUCTIONS

  • Install Node.js

  • Install the required npm modules by issuing these commands:

    npm install -g yo generator-phaser

  • Create a new directory for your game:

    • Unix/OSX : mkdir ~/Desktop/mygame && cd $_
    • Windows : mkdir %USERPROFILE%\Desktop\mygame && cd %USERPROFILE%\Desktop\mygame
  • Invoke the generator:

    yo phaser

  • Invoke the state generator (Note: this updates & overwrites main.js):

    yo phaser:state

  • Invoke the prefab generator:

    yo phaser:prefab

  • Invoke the shader generator:

    yo phaser:shader

  • Run a local development server (livereload enabled) with this command:

    npm start

  • Package your game (i.e. minify css, html and js) with:

    npm run build

Notes

The game's main.js file will be updated with new states when you run the state generator.
It adds in .js files found in the src/states/ directory.

CREDITS

主要指标

概览
名称与所有者julien/generator-phaser
主编程语言JavaScript
编程语言JavaScript (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2013-11-01 17:11:33
推送于2024-12-26 00:20:45
最后一次提交2024-12-26 01:19:36
发布数0
用户参与
星数259
关注者数17
派生数32
提交数231
已启用问题?
问题数27
打开的问题数0
拉请求数42
打开的拉请求数0
关闭的拉请求数7
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?