All Projects → yandeu → Phaser Project Template

yandeu / Phaser Project Template

Licence: mit
🕹️ Phaser 3 - Starter Template with TypeScript and webpack.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Phaser Project Template

Phaser Project Template Es6
Phaser 3 - Starter Template with ES6 (ESNext features included) and webpack.
Stars: ✭ 142 (-23.66%)
Mutual labels:  webpack, starter-template, phaser, html5-game, pwa
Universal Native Boilerplate
Build apps for every native platform with React and React Native
Stars: ✭ 131 (-29.57%)
Mutual labels:  webpack, pwa
Reldens
Reldens - You can make it - Open Source MMORPG Platform
Stars: ✭ 130 (-30.11%)
Mutual labels:  phaser, html5-game
Monitaure
🔔 A server uptime monitoring progressive web application - NO LONGER MAINTAINED
Stars: ✭ 135 (-27.42%)
Mutual labels:  webpack, pwa
Knowledge
文档着重构建一个完整的「前端技术架构图谱」,方便 F2E(Front End Engineering又称FEE、F2E) 学习与进阶。
Stars: ✭ 1,620 (+770.97%)
Mutual labels:  webpack, pwa
Webpack Typescript Starter
A simple Webpack 2 + TypeScript starter
Stars: ✭ 117 (-37.1%)
Mutual labels:  webpack, starter-template
Learning Article
学习资源 or 大前端导航,持续更新
Stars: ✭ 1,719 (+824.19%)
Mutual labels:  webpack, pwa
Phaser3 Tilemap Pack
Phaser 3 Project Template with Webpack, Tilemap, and Asset Pack
Stars: ✭ 87 (-53.23%)
Mutual labels:  webpack, phaser
Generator Phaser Plus
[🛑 DISCONTINUED] It has been a long journey but development of `generator-phaser-plus` is now over. I recommend you have a look and fork `yandeu/phaser-project-template` instead.
Stars: ✭ 148 (-20.43%)
Mutual labels:  webpack, phaser
Awesome Vue Cli3 Example
🦅 Awesome example for rapid Vue.js development using vue-cli3 .
Stars: ✭ 160 (-13.98%)
Mutual labels:  webpack, pwa
Vlackjack
Blackjack built with Vue.js and vuex
Stars: ✭ 109 (-41.4%)
Mutual labels:  webpack, html5-game
Slither.io Clone
Learn how to make Slither.io with JavaScript and Phaser! This game clones all the core features of Slither.io, including mouse-following controls, snake collisions, food, snake growth, eyes, and more. Progress through each part of the source code with our Slither.io tutorial series.
Stars: ✭ 168 (-9.68%)
Mutual labels:  phaser, html5-game
Node Flowtype Boilerplate
This boilerplate repository is outdated and no longer maintained. Instead, I strongly recommend to use TypeScript.
Stars: ✭ 104 (-44.09%)
Mutual labels:  starter-template, project-template
Webapp Webpack Plugin
[DEPRECATED] use favicons-webpack-plugin instead
Stars: ✭ 127 (-31.72%)
Mutual labels:  webpack, pwa
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-51.08%)
Mutual labels:  starter-template, pwa
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (+803.23%)
Mutual labels:  phaser, html5-game
Api Blueprint Boilerplate
Minimalistic boilerplate to quick-start API specification using API Blueprint description language.
Stars: ✭ 71 (-61.83%)
Mutual labels:  starter-template, project-template
Phaser Es6 Webpack
A bootstrap project for create games with Phaser + ES6 + Webpack.
Stars: ✭ 1,266 (+580.65%)
Mutual labels:  webpack, phaser
Preact Minimal
🚀 Minimal preact structure
Stars: ✭ 136 (-26.88%)
Mutual labels:  webpack, pwa
Template React Ssr
Server-side rendering template using express and react 16
Stars: ✭ 166 (-10.75%)
Mutual labels:  webpack, pwa


header
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.

GitHub package.json version GitHub last commit

Key FeaturesPreviewHow To Useenable3dPWANative AppCustom ConfigurationsES6Useful LinksMultiplayer GameExamplesCreditsLicense

Want to use ES6 instead of TypeScript? Check out the phaser-project-template-es6

Key Features

  • ESNext features ready (async/await, Rest/Spread operators)
  • Code Splitting
  • Obfuscation
  • Development Server with SourceMap and Live-Reload
  • PWA ready with offline support and "Add to Home screen" install prompt
  • Easy to build Native App using Capacitor
  • Includes Phaser 3 TypeScript typings
  • For development and production builds
  • Adds a webpack ContentHash to the JavaScript files (in production)

Preview

This is what you get after installing this template. A simple and clean starter template written in TypeScript. Try it!

How To Use

To clone and run this template, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository (yes, npx not npm)
$ npx gitget yandeu/phaser-project-template phaser-template

# Go into the repository
$ cd phaser-template

# Install dependencies
$ npm install

# Start the local development server (on port 8080)
$ npm start

# Ready for production?
# Build the production ready code to the /dist folder
$ npm run build

# Play your production ready game in the browser
$ npm run serve

Change the gameName in /webpack/webpack.common.js.

All your game code lies inside the /src/scripts folder. All assets need to be inside the /src/assets folder in order to get copied to /dist while creating the production build. Do not change the name of the index.html and game.ts files.

enable3d

enable3d logo

Want to add 3D objects and physics to your Phaser game? Checkout enable3d!

Progressive Web App (PWA)

PWA

This template is 100% PWA ready.

The ServiceWorker is disabled by default. Uncomment the line below inside /src/index.html to enable it.

<script>
  if ('serviceWorker' in navigator) {
    window.addEventListener('load', () => {
      navigator.serviceWorker.register('./sw.js')
    })
  }
</script>

You can easily personalize its settings by following these steps:

  • Replace both icons in /pwa/icons with your own.
    • One is 512x512 the other 192x192
  • Add your own favicon.ico to /src
  • Adjust these parameters in the manifest.json file in /pwa
    • short_name: Max. 12 characters
    • name: The full game name
    • orientation: "landscape" or "portrait"
    • background_color: color of the splash screen
    • theme_color: color of the navbar - has to match the theme-color in the index.html file
  • You can leave the sw.js (serviceWorker) in /pwa how it is.
  • Change the gameName in /webpack/webpack.common.js

Read more about PWA on developers.google.com

Native App

The simplest way to build a Native App is using Capacitor and following its Documentation. The only thing you need to change after installing Capacitor is the webDir inside the capacitor.config.json file. Set it to dist like so:

{
  "appId": "com.example.app",
  "appName": "YOUR_APP_NAME",
  "bundledWebRuntime": false,
  "webDir": "dist"
}

Custom Configurations

TypeScript Compiler

Change the TypeScript compiler's settings in the tsconfig.json file.

If you are new to TypeScript, you maybe want to set "noImplicitAny" to false.

You'll find more information about the TypeScript compiler here.

Typings

You can put your custom type definitions inside typings/custom.d.ts.

Webpack

All webpack configs are in the webpack folder.

Obfuscation

Obfuscation is disabled by default.

We are using the webpack-obfuscator. Change its settings in webpack/webpack.prod.js if needed. All available options are listed here.

ES6

Want to use ES6 instead of TypeScript? Switch to the phaser-project-template-es6

Multiplayer Game

Making a multiplayer game? Check out geckos.io

Useful Links

Examples

Game Examples Built with this Starter Template

Platformer Example [Play this game - Visit its Repository]

phaser3-typescript-platformer

Phaser 3 + Matter.js: Car Example [Play this game - Visit its Repository]

phaser3-matter-car-example

Credits

A huge thank you to Rich @photonstorm for creating Phaser

License

The MIT License (MIT) 2021 - Yannick Deubel. Please have a look at the LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].