Skip to content

A boilerplate for games using Phaser CE with TypeScript and Vite.

License

Notifications You must be signed in to change notification settings

yuigoto/phaser3-vite

Repository files navigation

phaser3-vite

Boilerplate for games using Phaser 3 and Vite, based on my Phaser 3 + Webpack boilerplate.

⚠️ DISCLAIMER

The images and sounds in this project come from my Ludum Dare 42/LOWREZJAM 2018 game, found here. As such, I own the rights to them and they are not free to use. If you want to use this project as a base for your own game, please replace/remove the images and sounds with your own.


Requirements


How To

Clone or fork this repository, run npm install (or yarn) to install all dependencies. After that, run any of these commands:

  • npm run dev (or yarn dev) to start the local development server with hot reloading;
  • npm run build (or yarn build) to build the project for production;
  • npm run preview (or yarn preview) to preview the production build locally;

Project Structure

The project structure might look a little bit strange and wonky, but that's what worked best for me. The important thing to point is on the diagram below:

- index.html
- vite.config.ts
- public/
  - favicon.ico
  - preview.png
- src/
  - assets/ <------------ Contains all asset files, loaded by '/game/assets'
    - audio/
    - data/
    - fonts/
    - img/
    - scss/
  - core/
    - constants/
    - entities/
    - interfaces/
    - types/
    - utils/
  - game/
    - assets/ <---------- Contains all game asset objects loading from `/assets`
      - atlas/
      - audio/
      - image/
      - sound/
      - spritesheet/
      - tilemap/
    - config/
    - scenes/
  - global.d.ts <-------- Global type definitions
  - index.ts
  - info.json <---------- Contains game information, used by `/game/config`
  - main.ts
  - vite.d.ts <---------- Vite type definitions, DO NOT MODIFY IF YOU DON'T KNOW WHAT YOU'RE DOING

Authors

See AUTHORS.md for more information.


License

This project is licensed under the MIT License. See the LICENSE.md file for details.


©2022 Fabio Y. Goto

About

A boilerplate for games using Phaser CE with TypeScript and Vite.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published