diff --git a/src/App.vue b/src/App.vue index 9de3f91..7cbd54f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,10 @@
-
+
{{score}}
@@ -13,7 +16,7 @@
-
@@ -77,6 +80,7 @@ export default { data() { return { + colors: ["green", "red", "blue", "yellow"], started: false, audioContext: null, oscMain: null, @@ -93,22 +97,22 @@ export default { spaces: [ { key: "Q", - tone: 196.00, + tone: 220.00, klass: 'piece-t-l' }, { key: "W", - tone: 220.00, + tone: 261.63, klass: 'piece-t-r' }, { key: "A", - tone: 261.63, + tone: 293.66, klass: 'piece-b-l' }, { key: "S", - tone: 293.66, + tone: 329.63, klass: 'piece-b-r' }, ] @@ -164,6 +168,7 @@ export default { checkInput(i) { if(!this.playing) { + this.blink = i if(this.check.length < this.pattern.length) { this.playOSC(this.spaces[i].tone) this.check.push(i) @@ -171,6 +176,7 @@ export default { for(let i = 0; i < this.check.length; i++) { if(this.check[i] != this.pattern[i]) { + this.blink = null this.fail = true } } @@ -187,11 +193,13 @@ export default { this.fail = false },200) + this.blink = null this.check = [] this.addToPattern() this.playPattern() },200) } + } }, @@ -243,19 +251,30 @@ export default {