refactor gameover animations

This commit is contained in:
Kevin Ngo
2018-10-10 02:24:22 -07:00
parent 46b7b19b5a
commit f46f4e04b5
6 changed files with 77 additions and 98 deletions

View File

@@ -9,27 +9,30 @@
<audio id="introSong" src="assets/sounds/introSong.ogg" loop></audio>
<a-scene
mixin="gameoverAnimation"
bind__beat-loader="challengeId: challenge.id; difficulty: challenge.difficulty; isPlaying: isPlaying"
bind__gameover="isGameOver: isGameOver"
bind__intro-song="isPlaying: menu.active && !menuSelectedChallenge.id"
bind__song="challengeId: challenge.id; isPlaying: isPlaying && !challenge.isLoading"
bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id"
bind__stage-colors="isGameOver: isGameOver"
bind__overlay="enabled: !isPlaying"
animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"
animation__gameoverfog="property: components.fog.el.object3D.fog.color; type: color; to: #330000; startEvents: gameover; dur: 500; easing: easeInQuad"
console-shortcuts
debug-controller
effect-bloom="strength: 1"
loading-screen="backgroundColor: #000;"
overlay="objects: #menu, #keyboard, #rightHand, #leftHand, [mixin~='cursorMesh'], #inGameMenu"
pool__beat-arrow-blue="mixin: beat arrow-blue-beat; size: 5; container: #beatContainer"
pool__beat-arrow-red="mixin: beat arrow-red-beat; size: 10; container: #beatContainer"
pool__beat-dot-blue="mixin: beat dot-blue-beat; size: 10; container: #beatContainer"
pool__beat-dot-red="mixin: beat dot-red-beat; size: 10; container: #beatContainer"
pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 5; container: #beatContainer"
pool__beat-arrow-red="mixin: arrowRedBeat; size: 10; container: #beatContainer"
pool__beat-dot-blue="mixin: dotBlueBeat; size: 10; container: #beatContainer"
pool__beat-dot-red="mixin: dotRedBeat; size: 10; container: #beatContainer"
proxy-event__menuleft="event: menuchallengeunselect; to: .menuAnimation"
proxy-event__menuright="event: menuchallengeselect; to: .menuAnimation"
proxy-event__cleargame1="event: pausemenuexit; as: cleargame; to: a-scene"
proxy-event__cleargame2="event: pausemenurestart; as: cleargame; to: a-scene"
search
stage-colors="blue"
fog="color: #a00; density: 0.035; type: exponential">
<a-assets timeout="10000">
<a-asset-item id="arrowObj" src="assets/models/arrow.obj"></a-asset-item>
@@ -68,10 +71,13 @@
<a-mixin id="font" text="font: assets/fonts/Teko-Bold.json; shader: msdf; letterSpacing: 1"></a-mixin>
<a-mixin id="textFont" text="font: assets/fonts/Teko-Bold.json; shader: msdf; letterSpacing: 1"></a-mixin>
<a-mixin id="beat" beat></a-mixin>
<a-mixin id="arrow-blue-beat" beat="color: blue; type: arrow"></a-mixin>
<a-mixin id="arrow-red-beat" beat="color: red; type: arrow"></a-mixin>
<a-mixin id="dot-blue-beat" beat="color: blue; type: dot"></a-mixin>
<a-mixin id="beat" visible="false"></a-mixin>
<a-mixin id="beatBlock" mixin="gameoverAnimation" animation__gameover="property: components.material.material.opacity; from: 1; to: 0; startEvents: gameover"></a-mixin>
<a-mixin id="beatSign" mixin="gameoverAnimation" animation__gameover="property: components.material.material.opacity; from: 1; to: 0; startEvents: gameover"></a-mixin>
<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>
<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>
<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>
<a-mixin id="gameoverAnimation" animation__gameover="dur: 1000; easing: easeOutQuad"></a-mixin>
<a-mixin id="badBeat"
geometry="primitive: plane"