Created
July 20, 2016 13:51
-
-
Save rudyjahchan/09ebacf5e46344e05d5f00bb19406c82 to your computer and use it in GitHub Desktop.
A-Frame Deadly Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '../core/component'; | |
export default class Deadly extends Component { | |
init() { | |
this.el.addEventListener('collide', e => this.onCollision(e)); | |
} | |
onCollision(event) { | |
event.detail.body.el.emit('death', event); | |
} | |
} | |
Deadly.register(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment