fix victory rank text layout when has + or -

This commit is contained in:
Kevin Ngo
2018-12-03 17:01:31 -08:00
parent 925a132843
commit f52ce1afd5
2 changed files with 4 additions and 6 deletions

View File

@@ -224,7 +224,7 @@ AFRAME.registerState({
state.score.beatsHit = 125;
state.score.beatsMissed = 125;
state.score.maxCombo = 123;
state.score.rank = 'B';
state.score.rank = 'C';
state.score.score = 9001;
computeBeatsText(state);
},
@@ -453,10 +453,8 @@ AFRAME.registerState({
const accuracy = (state.score.score / (totalBeats * 110)) * 100;
state.score.accuracy = accuracy;
if (accuracy === 1) {
if (accuracy >= 95) {
state.score.rank = 'S';
} else if (accuracy >= 98) {
state.score.rank = 'A+';
} else if (accuracy >= 93) {
state.score.rank = 'A';
} else if (accuracy >= 90) {

View File

@@ -20,11 +20,11 @@
bind__animation="enabled: isVictory"
bind__victory-rank="rank: score.rank"
scale="0 0 0"
position="0 0.2 0.125"
position="0 0.15 0.25"
animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"
animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"
play-sound="sound: #victorySound; event: textcounterdone"
text="wrapCount: 2; align: center; baseline: top; width: 0.82; side: double"></a-entity>
text="wrapCount: 3; align: center; baseline: center; width: 0.82; side: double"></a-entity>
<a-entity
id="victoryInfoAccuracy"