An example mobile game with use of Phaser, Parcel and Cordova.
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This starter brings Phaser 3, Parcel, and Apache Cordova together so you can ship a mobile-ready prototype in minutes. Parcel 2 powers the development server, while a custom build script outputs Cordova-friendly bundles to www/. The default scene recreates the official Phaser platformer tutorial, complete with physics, collectibles, and touch-ready input hooks.
Why this template helps you move fast:
- Cordova configuration for Browser and iOS platforms is already wired up, including plugin stubs and splash handling.
- Parcel dev tooling delivers hot-reload while keeping asset imports simple through ES modules.
- A production build script injects
cordova.jsautomatically and produces ready-to-run assets for emulator or device testing.
The project will keep evolving—issues and pull requests are welcome if you spot gaps or want to contribute enhancements.
phaser3-parcel-cordova-project-template/
├── src/ # Game source (HTML shell, Phaser entry, scenes, assets, styles)
├── scripts/ # Build utilities (Parcel v1 bundler script for Cordova output)
├── config.xml # Cordova application manifest and platform preferences
├── package.json # npm scripts, dependencies, and Cordova platform definitions
├── license.txt # Project license (MIT)
└── readme.md # Project overview and contributor docs
Key runtime files:
src/index.jsstarts the Phaser game and waits fordevicereadyon devices.src/game.jshosts the sample platformer scene, assets, and physics configuration.scripts/beforeBuild.jsbundles towww/and injects thecordova.jsscript tag post-build.
This game was built with following technologies.
To start working with boilerplate, please follow instructions below.
You need the following tooling before running the project:
- Node.js & npm – install from nodejs.org or via a version manager.
- Cordova CLI (global)
npm install -g cordova
Use the steps below to install dependencies and boot the template locally.
- Clone the repo
git clone https://github.com/michalzagrodzki/phaser3-parcel-cordova-project-template.git cd phaser3-parcel-cordova-project-template - Install dependencies
npm install
- Add the Cordova browser platform (skip if already present)
cordova platform add browser
- Start the Parcel dev server with hot reload
npm run dev
Use these commands to bundle the project for Cordova and launch the provided targets.
- Create a production bundle for Cordova
npm run build
- Run the bundled app in a Cordova browser shell
npm run web
- Launch the iOS emulator (requires Xcode tooling)
npm run ios
This boilerplate is a starting point for further development of games for mobile platforms.
Start by modifying the logic in src/game.js, then add new scenes under src/ and register them within the scene array in src/index.js.
For guidance and examples on how to develop games with Phaser, please refer to the Documentation
- Add Changelog
- Add Deployment Steps
- Add Additional Templates w/ Examples
- Add Support for Typescript
- Multi-language Support
- Spanish
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See license.txt for more information.
Michal Zagrodzki - @michalzagrodzki
Project Link: https://github.com/michalzagrodzki/phaser3-parcel-cordova-project-template
Following resources were helpful in building this boilerplate:
