Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remarkablegames/phaser-template
đšī¸ Phaser game template
https://github.com/remarkablegames/phaser-template
javascript phaser phaser-boilerplate phaser-framework phaser-game phaser-games phaser-template remarkablegames typescript web website
Last synced: 3 days ago
JSON representation
đšī¸ Phaser game template
- Host: GitHub
- URL: https://github.com/remarkablegames/phaser-template
- Owner: remarkablegames
- License: mit
- Created: 2018-01-07T03:10:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-11T23:40:20.000Z (5 days ago)
- Last Synced: 2024-11-12T00:28:41.503Z (5 days ago)
- Topics: javascript, phaser, phaser-boilerplate, phaser-framework, phaser-game, phaser-games, phaser-template, remarkablegames, typescript, web, website
- Language: TypeScript
- Homepage: https://remarkablegames.org/phaser-template
- Size: 2.85 MB
- Stars: 13
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# phaser-template
phaser-template is a template for making [Phaser](https://phaser.io/) games.
Inspired by the tutorial "[Making your first Phaser 3 game](https://phaser.io/tutorials/making-your-first-phaser-3-game)".
Demo:
- [remarkablegames](https://remarkablegames.org/phaser-template/)
- [CodeSandbox](https://codesandbox.io/s/phaser-template-4fy4y)Stack:
- [Phaser](https://phaser.io/)
- [Vite](https://vitejs.dev/)
- [GitHub Pages](https://pages.github.com/)## Prerequisites
- [nvm](https://github.com/nvm-sh/nvm#readme)
## Install
Clone the repository:
```sh
git clone https://github.com/remarkablegames/phaser-template.git
cd phaser-template
```Rename the project:
```sh
git grep -l phaser-template | xargs sed -i '' -e 's/phaser-template/my-game/g'
git grep -l 'Phaser Template' | xargs sed -i '' -e 's/Phaser Template/My Game/g'
```Update the files:
- [ ] `README.md`
- [ ] `package.json`
- [ ] `index.html`
- [ ] `public/manifest.json`
- [ ] `src/index.ts`Install the dependencies:
```sh
npm install
```Initialize a new repository:
```sh
rm -rf .git
git init
```Make your first commit:
```sh
git add .
git commit -m 'feat: initialize project from phaser-template'
```> [!NOTE]
> Commit messages follow [Conventional Commits](https://conventionalcommits.org/), which helps with release.Once you're ready, [push the local repository to GitHub](https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/) (or another remote repository):
```sh
git remote add origin
git push origin -u origin master
```## Environment Variables
Set the environment variables:
```sh
less .env
```Update the **Secrets** in the repository **Settings**.
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the game in the development mode.
Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
The page will reload if you make edits.
You will also see any errors in the console.
### `npm run build`
Builds the game for production to the `dist` folder.
It correctly bundles in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your game is ready to be deployed!
### `npm run bundle`
Builds the game and packages it into a Zip file in the `dist` folder.
Your game can be uploaded to your server, [Itch.io](https://itch.io/), [Newgrounds](https://www.newgrounds.com/), etc.
## License
[MIT](LICENSE)