work on victory screen. debugstate component (?debugstate=victory, ?debugstate=gameover, ?debugstate=loading)

This commit is contained in:
Kevin Ngo
2018-10-17 02:55:18 -07:00
parent d0610c3e4b
commit 8bcd5358a9
7 changed files with 112 additions and 49 deletions

View File

@@ -0,0 +1,12 @@
/**
* Emit events from query parameter to state to automatically set up state.
*/
AFRAME.registerComponent('debug-state', {
play: function () {
const flags = AFRAME.utils.getUrlParameter('debugstate').trim();
if (!flags) { return; }
flags.split(',').forEach(flag => {
this.el.sceneEl.emit(`debug${flag.trim()}`, null, false);
});
}
});