Giter VIP home page Giter VIP logo

phaser3-spine-simple's Introduction

Simple Phaser with SpinePlugin Example

Phaser with SpinePlugin in the simplest form without npm or tooling

Overview

This example is a simple, barebones setup with the SpinePlugin that loads SpineBoy. There is no use of npm or any other tooling. Scripts are included in index.html via script tags.

phaser.min.js was taken from https://github.com/photonstorm/phaser/tree/master/dist

SpinePlugin.min.js was taken from https://github.com/photonstorm/phaser/tree/master/plugins/spine/dist

The entry point is main.js.

This example was last checked with Phaser v3.22

Check out this article for a more detailed set up guide.

Running the Example

You will need to run a local web server to run this example. If you have python installed:

python -m SimpleHTTPServer 8080

Or if you have node and the http-server package:

http-server

Both commands need to be run on the directory containing the example code. If you clone or download this example then it will be something like:

cd phaser3-spine-simple
http-server

For more information on local server options, including from VSCode or Brackets, check out this article.

Alternative Loading Option

If you are running into errors using the example code then try loading the SpinePlugin as a PackFile. Update your scene config to add the pack key like this:

const config = {
  // ...
  scene: {
    preload: preload,
    create: create,
    pack: {
      files: [
        { type: 'scenePlugin', key: 'SpinePlugin', url: 'SpinePlugin.min.js', sceneKey: 'spine' }
      ]
    }
  }
}

var game = new Phaser.Game(config)

And remove <script src="SpinePlugin.min.js"></script> from your index.html.

phaser3-spine-simple's People

Contributors

supertommy 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.