manuelmauro / phaser-tiled-phisics

A simple physics for a tiled world

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tiled Physics for Phaser

A simple physics for a tiled world. Bodies move discreetely from tile to tile, collide with other bodies, and are subject to tile modifiers like: collision, force, inertia, and many more to come.

Installation

In order to use the plugin, add the file /dist/TiledPhysics.js or its minified version to your assets (for instance inside assets/plugins/ folder).

Add the following lines to your Phaser config object:

const config = {
  ...
  physics: {
    tiled: {
      tileHeight: 8,
      tileWidth: 8,
      debug: false,
    }
  },
};

Finally you can install it to a specific scene adding to the preload() function the following lines:

this.load.scenePlugin({
  key: 'TiledPhysics',
  url: 'assets/plugins/TiledPhysics.js',
});

Thanks to

About

A simple physics for a tiled world

License:MIT License


Languages

Language:JavaScript 100.0%Language:HTML 0.0%Language:CSS 0.0%