If you need typescript support checkout the typescript
branch. Thanks to @MatsMaker
You'll need to install a few things before you have a working copy of the project.
Navigate into your workspace directory.
Run:
git clone https://github.com/lean/phaser-es6-webpack.git
Navigate to the cloned repo's directory.
Run:
npm install
or if you chose yarn, just run yarn
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.
Run:
npm run deploy
This will optimize and minimize the compiled bundle.
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 :
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.
before you get to work you will surely want to check the config file. You could setup dimensions, webfonts, etc
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
Big thanks to these great repos:
https://github.com/belohlavek/phaser-es6-boilerplate
https://github.com/cstuncsik/phaser-es6-demo
一、新建项目 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 •