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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?