From 5e43d0107a97b20deed918cf0138c1956f0b0ac3 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Sat, 17 Nov 2018 05:52:43 -0800 Subject: [PATCH] rename victoryfake event to test victory --- src/components/song.js | 2 +- src/state/index.js | 5 +++++ src/templates/victory.html | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/song.js b/src/components/song.js index 49e48e8..9faebbc 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -44,7 +44,7 @@ AFRAME.registerComponent('song', { this.el.addEventListener('wallhitend', this.onWallHitEnd.bind(this)); if (process.env.NODE_ENV !== 'production') { - this.el.addEventListener('fakevictory', () => { + this.el.addEventListener('victoryfake', () => { this.source.stop(); this.source.disconnect(); this.victory(); diff --git a/src/state/index.js b/src/state/index.js index ec015b3..9f2adce 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -437,6 +437,11 @@ AFRAME.registerState({ computeBeatsText(state); }, + victoryfake: function (state) { + state.score.accuracy = '12.34%'; + state.score.rank = 'F'; + }, + wallhitstart: function (state) { takeDamage(state); } diff --git a/src/templates/victory.html b/src/templates/victory.html index acb4a91..cbc281f 100644 --- a/src/templates/victory.html +++ b/src/templates/victory.html @@ -30,7 +30,7 @@ id="victoryInfoAccuracy" mixin="font" bind__text-counter="value: score.accuracy" - text="align: left; color: #FAFAFA; wrapCount: 22; baseline: top; width: 0.81" + text="align: left; color: #FAFAFA; wrapCount: 22; baseline: top; width: 0.81; value: 0.00%" text-counter="suffix: %; decimals: 2; emit: true" proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe" position="0.75 0.725 0">