Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manuelmauro/phaser-tiled-phisics
A simple physics for a tiled world
https://github.com/manuelmauro/phaser-tiled-phisics
Last synced: 7 days ago
JSON representation
A simple physics for a tiled world
- Host: GitHub
- URL: https://github.com/manuelmauro/phaser-tiled-phisics
- Owner: manuelmauro
- License: mit
- Created: 2018-12-19T10:50:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-28T09:55:31.000Z (over 2 years ago)
- Last Synced: 2024-10-30T06:25:02.236Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.02 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```js
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:
```js
this.load.scenePlugin({
key: 'TiledPhysics',
url: 'assets/plugins/TiledPhysics.js',
});
```## Thanks to
- The Phaser team @photonstorm, @mikewesthad and @pavle-goloskokovic for building
Phaser 3, this project is deeply based on their Arcade physics
- @nkholski for https://github.com/nkholski/phaser3-es6-webpack and his inspiring
project https://github.com/nkholski/phaser-grid-physics