phaser-es6-webpack

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 唐默
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Phaser + ES6 + Webpack.

A bootstrap project to create games with Phaser + ES6 + Webpack.

Phaser+ES6+Webpack

Phaser 3 supported in this branch: https://github.com/lean/phaser-es6-webpack/tree/phaser3

Typescript supported in this branch: https://github.com/lean/phaser-es6-webpack/tree/typescript

Features

  • ESLINT with JavaScript Standard Style configuration
  • Next generation of Javascript
  • Browsers are automatically updated as you change project files
  • Webpack ready
  • WebFont Loader
  • Multilanguage support
  • PWA Support

Typescript

If you need typescript support checkout the typescript branch. Thanks to @MatsMaker

Setup

You'll need to install a few things before you have a working copy of the project.

1. Clone this repo:

Navigate into your workspace directory.

Run:

git clone https://github.com/lean/phaser-es6-webpack.git

2. Install node.js and npm:

https://nodejs.org/en/

3. Install dependencies (optionally you can install yarn):

Navigate to the cloned repo's directory.

Run:

npm install

or if you chose yarn, just run yarn

4. Run the development server:

Run:

npm run dev

This will run a server so you can run the game in a browser. It will also start a watch process, so you can change the source and the process will recompile and refresh the browser automatically.

To run the game, open your browser and enter http://localhost:3000 into the address bar.

Build for deployment:

Run:

npm run deploy

This will optimize and minimize the compiled bundle.

Deploy for cordova:

Make sure to uncomment the cordova.js file in the src/index.html and to update config.xml with your informations. (name/description...)

More informations about the cordova configuration:https://cordova.apache.org/docs/en/latest/config_ref/

There is 3 platforms actually tested and supported :

  • browser
  • ios
  • android

First run (ios example):

npm run cordova
cordova platform add ios
cordova run ios

Update (ios example):

npm run cordova
cordova platform update ios
cordova run ios

This will optimize and minimize the compiled bundle.

Config:

before you get to work you will surely want to check the config file. You could setup dimensions, webfonts, etc

Webfonts:

In the config file you can specify which webfonts you want to include. In case you do not want to use webfonts simply leave the array empty

Credits

Big thanks to these great repos:

https://github.com/belohlavek/phaser-es6-boilerplate

https://github.com/cstuncsik/phaser-es6-demo

Contributors

https://github.com/RenaudROHLINGER

  • 一、新建项目 1. 项目文件夹 在本地合适位置新建项目文件夹,用以存放项目代码 2. 项目目录结构 新建项目结构如下 - 根目录 - src - assets - scene - sprite - util - config - webpack 其中 src:用于存放项目代码 assets:项目资源,如图片,声音等 scene:phaser3 的场景类 sprite:ph

  • I am writing this article to help people that are just starting to learn Phaser 3 and need extra support when deploying their game to production. This tutorial will focus on configuring your app with

  • 虽然这个小游戏逻辑不是很复杂,但为了熟悉Phaser这个游戏框架的使用方法所以就选择了它。 另外第一次在项目中尝试使用ES6,之后利用babel进行转换。 自动化构建:gulp(其他文件复制和解析) + webpack(负责js的模块打包) + browser-sync(实时预览); 刚开始拿到项目的交互后,对游戏功能进行了分析,然后将整个游戏大致分”游戏启动前、加载、游戏、结束“4个场景。确定场

 相关资料
  • Phaser 是一个快速、免费、有趣的开源HTML5游戏框架,在桌面和移动网络浏览器上提供WebGL和Canvas渲染功能。游戏可以通过使用第三方工具编译成iOS、Android和本地应用程序。你可以使用JavaScript或TypeScript进行开发。

  • IonPhaser Web Component built with Stencil.js to integrate Phaser with any other framework. Inspired by the old IonPhaser directive Demo Do you want to see this web component in action? Visit https://

  • Phaser 2 Examples Looking for Phaser 3 Examples? They are in their own repo. Phaser v2 is a fast, free and fun open source HTML5 game framework. It uses Pixi.js for WebGL and Canvas rendering across d

  • Phaser CE (Community Edition) Phaser CE is a fast, free, and fun open source HTML5 game framework. It uses a custom build of Pixi.js for WebGL and Canvas rendering, and supports desktop and mobile web

  • expo-phaser Tools for using Phaser-ce to build native 2D games in Expo �� Installation Usage Functions Example Demo Installation yarn add expo-phaser Usage Import the library into your JavaScript file

  • Phaser 3 TypeScript Starter Template A starter template for Phaser 3 with TypeScript and webpack for building excellent html5-games that work great in the browser and on mobile devices. Key Features •