From 5b096a6107d3365cd98a52e63508e78706e0c707 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Sat, 26 Jul 2014 19:58:58 -0400 Subject: [PATCH] made combo reflect timer --- js/Hex.js | 2 +- js/checking.js | 5 +++-- js/main.js | 2 +- js/update.js | 2 +- js/wavegen.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/Hex.js b/js/Hex.js index ba82ef4..c1ca1bc 100644 --- a/js/Hex.js +++ b/js/Hex.js @@ -166,4 +166,4 @@ function Hex(sideLength) { function arrayToColor(arr){ return 'rgb(' + arr[0]+ ','+arr[1]+','+arr[2]+')'; -} \ No newline at end of file +} diff --git a/js/checking.js b/js/checking.js index 32bbdd0..89f6a9b 100644 --- a/js/checking.js +++ b/js/checking.js @@ -68,14 +68,15 @@ function consolidateBlocks(hex,side,index){ // add scores var now = MainHex.ct; - if(now - hex.lastCombo < 240 ){ - settings.comboTime = waveone.nextGen/16.6666667 * 3.95; + if(now - hex.lastCombo < settings.comboTime ){ + settings.comboTime = waveone.nextGen/16* 2; hex.comboMultiplier += 1; hex.lastCombo = now; var coords = findCenterOfBlocks(deletedBlocks); hex.texts.push(new Text(coords['x'],coords['y'],"x "+hex.comboMultiplier.toString(),"bold Q","#fff",fadeUpAndOut)); } else{ + settings.comboTime = 240; hex.lastCombo = now; hex.comboMultiplier = 1; } diff --git a/js/main.js b/js/main.js index c0ccf83..75256e5 100644 --- a/js/main.js +++ b/js/main.js @@ -149,7 +149,7 @@ function init(b) { MainHex.y = -100; startTime = Date.now(); - waveone = saveState.wavegen || new waveGen(MainHex,Date.now(),[1,1,0],[1,1],[1,1]); + waveone = saveState.wavegen || new waveGen(MainHex); MainHex.texts = []; //clear texts MainHex.delay = 15; diff --git a/js/update.js b/js/update.js index 2422f5f..c8c0320 100644 --- a/js/update.js +++ b/js/update.js @@ -1,6 +1,6 @@ //remember to update history function to show the respective iter speeds function update() { - var now = Date.now(); + var now = MainHex.ct; if (gameState == 1) { waveone.update(); if (now - waveone.prevTimeScored > 1000) { diff --git a/js/wavegen.js b/js/wavegen.js index 3a8a4a4..85b8251 100644 --- a/js/wavegen.js +++ b/js/wavegen.js @@ -196,4 +196,4 @@ function waveGen(hex) { // rest of generation functions this.currentFunction = this.randomGeneration; -} \ No newline at end of file +}