made combo reflect timer

This commit is contained in:
Garrett Finucane 2014-07-26 19:58:58 -04:00
parent f9ff5b4cea
commit 34ebaa03f9
5 changed files with 7 additions and 6 deletions

View file

@ -166,4 +166,4 @@ function Hex(sideLength) {
function arrayToColor(arr){
return 'rgb(' + arr[0]+ ','+arr[1]+','+arr[2]+')';
}
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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) {

View file

@ -196,4 +196,4 @@ function waveGen(hex) {
// rest of generation functions
this.currentFunction = this.randomGeneration;
}
}