- Hoang Trung Phong
- Nguyen Duy Kien
- Trinh Thi Thu
This project template has been set up using the Vue CLI 4 and includes:
- Sass
- CSS Postprocessing
- Babel
- Source Minification
# install dependencies
npm install
# serve with live reloading at localhost:8080
npm run dev
# build for production with transpilation / minification
npm run build
# serve your production build at localhost:5000
npm run serve
If you want to add more features like linting, unit testing or Typescript to your own project, you can do so quite easily via Vue CLI's plugin system. Read the documentation if you want to know more.
You might want to expose some game state that lives inside of your Phaser code to your Vue components and vice versa, for example a highscore. Here are two ways you can achieve sharing state between the frameworks.
-
Import a Phaser EventEmitter instance in both your Vue components and Phaser modules. Both sides can then listen to and emit events on that emitter.
-
Have both sides share a Vuex store instance. It works like an event emitter, but can also hold state. While the store is nicely integrated into your Vue components, on the Phaser side you'll have to use the raw store API.