Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/samme/phaser-plugin-follow
- Owner: samme
- Created: 2018-06-01T00:37:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T09:06:27.000Z (over 1 year ago)
- Last Synced: 2024-11-13T19:13:32.992Z (3 months ago)
- Topics: phaser, phaser-plugin, phaser3, phaser3-plugin
- Language: JavaScript
- Homepage:
- Size: 224 KB
- Stars: 11
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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);
```