{"id":19876545,"url":"https://github.com/gnuwilliam/playing-with-phaser","last_synced_at":"2026-06-30T19:31:06.698Z","repository":{"id":42854878,"uuid":"260844080","full_name":"gnuwilliam/playing-with-phaser","owner":"gnuwilliam","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T17:46:18.000Z","size":23,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T01:42:26.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnuwilliam.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-03T06:42:18.000Z","updated_at":"2020-05-03T06:42:22.000Z","dependencies_parsed_at":"2023-02-07T18:50:13.563Z","dependency_job_id":null,"html_url":"https://github.com/gnuwilliam/playing-with-phaser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"ourcade/phaser3-parcel-template","purl":"pkg:github/gnuwilliam/playing-with-phaser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuwilliam%2Fplaying-with-phaser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuwilliam%2Fplaying-with-phaser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuwilliam%2Fplaying-with-phaser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuwilliam%2Fplaying-with-phaser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnuwilliam","download_url":"https://codeload.github.com/gnuwilliam/playing-with-phaser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuwilliam%2Fplaying-with-phaser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34981390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T16:33:23.619Z","updated_at":"2026-06-30T19:31:06.667Z","avatar_url":"https://github.com/gnuwilliam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![phaser3-parceljs-template](https://user-images.githubusercontent.com/2236153/71606463-37a0da80-2b2e-11ea-9b5f-5d26ccc84f91.png)\n\n# Phaser3 + Parcel Template\n\u003e For people who want to spend time making games instead of configuring build tools.\n\n![License](https://img.shields.io/badge/license-MIT-green)\n\n## Prerequisites\n\nYou'll need [Node.js](https://nodejs.org/en/), [npm](https://www.npmjs.com/), and [Parcel](https://parceljs.org/) installed.\n\nIt is highly recommended to use [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm) to install Node.js and npm.\n\nFor Windows users there is [Node Version Manager for Windows](https://github.com/coreybutler/nvm-windows).\n\nInstall Node.js and `npm` with `nvm`:\n\n```bash\nnvm install node\n\nnvm use node\n```\n\nReplace 'node' with 'latest' for `nvm-windows`.\n\nThen install Parcel:\n\n```bash\nnpm install -g parcel-bundler\n```\n\n## Getting Started\n\nClone this repository to your local machine:\n\n```bash\ngit clone https://github.com/ourcade/phaser3-parcel-template.git\n```\n\nThis will create a folder named `phaser3-parcel-template`. You can specify a different folder name like this:\n\n```bash\ngit clone https://github.com/ourcade/phaser3-parcel-template.git my-folder-name\n```\n\nGo into your new project folder and install dependencies:\n\n```bash\ncd phaser3-parcel-template # or 'my-folder-name'\nnpm install\n```\n\nStart development server:\n\n```\nnpm run start\n```\n\nTo create a production build:\n\n```\nnpm run build\n```\n\nProduction files will be placed in the `dist` folder. Then upload those files to a web server. 🎉\n\n## Project Structure\n\n```\n    .\n    ├── dist\n    ├── node_modules\n    ├── public\n    ├── src\n    │   ├── scenes\n    │   │   ├── HelloWorldScene.js\n    │   ├── index.html\n    │   ├── main.js\n    ├── package.json\n```\n\nThe contents of this template is the basic [Phaser3 getting started example](http://phaser.io/tutorials/getting-started-phaser3/part5).\n\nThis template assumes you will want to organize your code into multiple files and use modern JavaScript (or TypeScript).\n\nJavaScript files are intended for the `src` folder. `main.js` is the entry point referenced by `index.html`.\n\nOther than that there is no opinion on how you should structure your project. There is a `scenes` folder in `src` where the `HelloWorldScene.js` lives but you can do whatever you want.\n\n## Static Assets\n\nAny static assets like images or audio files should be placed in the `public` folder. It'll then be served at http://localhost:8000/images/my-image.png\n\nExample `public` structure:\n\n```\n    public\n    ├── images\n    │   ├── my-image.png\n    ├── music\n    │   ├── ...\n    ├── sfx\n    │   ├── ...\n```\n\nThey can then be loaded by Phaser with `this.image.load('my-image', 'images/my-image.png')`.\n\n## Class Properties Support\n\nIf you want to use the modern ES6 class properties feature then you'll need to add a `.babelrc` file at the project root with the `@babel/plugin-proposal-class-properties` plugin.\n\n```\n{\n\t\"presets\": [\n\t\t\"env\"\n\t],\n\t\"plugins\": [\n\t\t\"@babel/plugin-proposal-class-properties\"\n\t]\n}\n```\n\nParcel should automatically install the necessary dependencies.\n\nIf you run into an error about mismatched major versions then go into `package.json` to see what the major versions for `@babel/core` and `@babel/plugin-proposal-class-properties` are.\n\nReinstall one or the other manually to make the versions match 😉\n\n## TypeScript\n\nCheck out the [phaser3-typescript-parcel-template](https://github.com/ourcade/phaser3-typescript-parcel-template) for a ready-to-use version of this template in TypeScript!\n\n---\n\nIt just works. (Thanks to Parcel)\n\nYou can rename all the `.js` files to `.ts` and start using TypeScript.\n\nYou may also want to add a `tsconfig.json` file to the project root like this:\n\n```\n{\n\t\"compilerOptions\": {\n\t\t\"target\": \"es2016\",\n\t\t\"module\": \"es6\",\n\t\t\"strict\": true,\n\t\t\"noImplicitAny\": false,\n\t\t\"noEmit\": true,\n\t\t\"allowJs\": true,\n\t\t\"jsx\": \"preserve\",\n\t\t\"importHelpers\": true,\n\t\t\"moduleResolution\": \"node\",\n\t\t\"experimentalDecorators\": true,\n\t\t\"esModuleInterop\": true,\n\t\t\"allowSyntheticDefaultImports\": true,\n\t\t\"sourceMap\": true,\n\t\t\"baseUrl\": \"./src\",\n\t\t\"paths\": {\n\t\t  \"~/*\": [\"./*\"]\n\t\t},\n\t\t\"typeRoots\": [\n\t\t\t\"node_modules/@types\",\n\t\t\t\"node_module/phaser/types\"\n\t\t],\n\t\t\"types\": [\n\t\t\t\"phaser\"\n\t\t]\n\t},\n\t\"include\": [\n\t\t\"src/**/*\"\n\t]\n}\n```\n\n[More information on `tsconfig.json` options here.](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)\n\n[Note on how Parcel handles `baseUrl` and `paths`.](https://gist.github.com/croaky/e3394e78d419475efc79c1e418c243ed)\n\n## Flow\n\nIt just works. (Thanks to Parcel)\n\nJust put `// @flow` at the top of your `.js` files. Parcel will handle the rest.\n\n[Go here for more information on how to use Flow](https://flow.org/).\n\n## Dev Server Port\n\nYou can change the dev server's port number by modifying the `start` script in `package.json`. We use Parcel's `-p` option to specify the port number.\n\nThe script looks like this:\n\n```\nparcel src/index.html -p 8000\n```\n\nChange 8000 to whatever you want.\n\n## Other Notes\n\n[parcel-plugin-clean-easy](https://github.com/lifuzhao100/parcel-plugin-clean-easy) is used to ensure only the latest files are in the `dist` folder. You can modify this behavior by changing `parcelCleanPaths` in `package.json`.\n\n[parcel-plugin-static-files](https://github.com/elwin013/parcel-plugin-static-files-copy#readme) is used to copy static files from `public` into the output directory and serve it. You can add additional paths by modifying `staticFiles` in `package.json`.\n\n## License\n\n[MIT License](https://github.com/ourcade/phaser3-parcel-template/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnuwilliam%2Fplaying-with-phaser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnuwilliam%2Fplaying-with-phaser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnuwilliam%2Fplaying-with-phaser/lists"}