Skip to content

Instantly share code, notes, and snippets.

@rudyjahchan
Created July 20, 2016 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudyjahchan/09ebacf5e46344e05d5f00bb19406c82 to your computer and use it in GitHub Desktop.
Save rudyjahchan/09ebacf5e46344e05d5f00bb19406c82 to your computer and use it in GitHub Desktop.
A-Frame Deadly Component
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