Giter Site home page Giter Site logo

qtie's Introduction

vue-phaser3

Webpack boilerplate that integrates Phaser 3 into a Vue 3 project.

This project template has been set up using the Vue CLI 4 and includes:

  • Sass
  • CSS Postprocessing
  • Babel
  • Source Minification

Build Setup

# install dependencies
npm install

# serve with live reloading at localhost:8080
npm run serve

# build for production with transpilation / minification
npm run build

# serve your production build at localhost:5000
npm start

Extending the project to your needs

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.

Converting into your own repository

If you want to maintain your own repo based on this boilerplate, you first need to detach it from this repo. Here is what you need to do:

  1. edit these files and enter your own project info

    • package.json
    • README.md
    • public/index.html
  2. delete LICENSE (and perhaps add your own)

  3. reinitialize git

rm -rf .git
git init
git add .
git commit -m "Initial commit"

Sharing data between Vue and Phaser

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.

qtie's People

Contributors

gramlin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.