Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Mobile Game

An example mobile game with use of Phaser, Parcel and Cordova.
View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

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.js automatically 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.

(back to top)

Project Structure

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.js starts the Phaser game and waits for deviceready on devices.
  • src/game.js hosts the sample platformer scene, assets, and physics configuration.
  • scripts/beforeBuild.js bundles to www/ and injects the cordova.js script tag post-build.

Built With

This game was built with following technologies.

  • Phaser
  • Parcel
  • Cordova

(back to top)

Getting Started

To start working with boilerplate, please follow instructions below.

Prerequisites

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

Installation

Use the steps below to install dependencies and boot the template locally.

  1. Clone the repo
    git clone https://github.com/michalzagrodzki/phaser3-parcel-cordova-project-template.git
    cd phaser3-parcel-cordova-project-template
  2. Install dependencies
    npm install
  3. Add the Cordova browser platform (skip if already present)
    cordova platform add browser
  4. Start the Parcel dev server with hot reload
    npm run dev

Building

Use these commands to bundle the project for Cordova and launch the provided targets.

  1. Create a production bundle for Cordova
    npm run build
  2. Run the bundled app in a Cordova browser shell
    npm run web
  3. Launch the iOS emulator (requires Xcode tooling)
    npm run ios

(back to top)

Usage

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

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See license.txt for more information.

(back to top)

Contact

Michal Zagrodzki - @michalzagrodzki

Project Link: https://github.com/michalzagrodzki/phaser3-parcel-cordova-project-template

(back to top)

Acknowledgments

Following resources were helpful in building this boilerplate:

(back to top)

Releases

Packages

Used by

Contributors

Languages