Giter Site home page Giter Site logo

saonam / phaser-capacitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnesher/phaser-capacitor

0.0 1.0 0.0 949 KB

Provides a simple boilerplate for Phaser 3 / Typescript games with the ability to easily deploy to iOS, Android and Desktop

License: Other

CSS 27.10% TypeScript 25.82% HTML 6.48% JavaScript 40.59%

phaser-capacitor's Introduction

Phaser-Capacitor boilerplate

This skeleton app allows you to easily develop a Phaser 3 game for iOS / Android / Desktop using the Ionic Capacitor library. It uses Typescript (though can also be written in JS) and Webpack

Installation

Simply clone or download the repository and then run npm install within the folder

Development

To set up a webpack development server simply run npm run dev you can also run npm run build to create a production build

Deployment

In order to set up a deployment target simply run npx cap add <platformName> where platformName can either be android, ios or electron - directory with the platform name will be created.

once you've set up your deployment target simply run npm run build-<platformName> - for example npm run build-android this will build the app to the dist folder, copy the files into the Android project and lunch Android Studio. Running an iOS build works similarly just with Xcode

keep in mind - the build process will fail if you have not installed the necessery software required to develop for your requested platform (Android / iOS).

Electron builds work a little differently as there's no IDE (like Android / Xcode) that is used to run them. Once you run npm run build-electron simply enter the Electron folder cd electron and then run npm run electron:start to have the Electron app start

If you wish to bundle your Electron app you will need to install a seperate bundler like electron-builder https://github.com/electron-userland/electron-builder. A complete guide can be find in the supplied link and there are additional bundlers you can choose.

Webpack exposes a global variable called BUILD_TARGET which contains the target platform (ios, android, electron or web) - web is the default when not building for a specific platform

important

  • While multiple deployment targets are supported different targets (desktop / mobile) will likely require some code changes.
  • This is still a work in progress, comments & suggestions are welcome

Guy N.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.