Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samme/phaser-plugin-follow

Track another object's position
https://github.com/samme/phaser-plugin-follow

phaser phaser-plugin phaser3 phaser3-plugin

Last synced: 2 months ago
JSON representation

Track another object's position

Awesome Lists containing this project

README

        

Phaser 3 Follow Plugin
======================

```javascript
new Phaser.Game({
plugins: {
scene: [{ key: 'FollowPlugin', plugin: PhaserFollowPlugin, mapping: 'follow' }]
}
});
```

`PhaserFollowPlugin` is a global reference to the plugin class. The package module exports the same value.

In a scene:

```javascript
this.follow.add(follower, {
target: target, // Required.
offsetX: 0,
offsetY: 0,
rotate: false,
rotateOffset: false
});

this.follow.pause(follower);

this.follow.resume(follower);

this.follow.remove(follower);
```