diff --git a/js/comboTimer.js b/js/comboTimer.js index 3c69762..8cda3b0 100644 --- a/js/comboTimer.js +++ b/js/comboTimer.js @@ -18,20 +18,24 @@ function drawSide(startVertex,endVertex,fraction){ endVertex = endVertex%6; ctx.globalAlpha=1; ctx.beginPath(); - ctx.lineCap = "round" - ctx.strokeStyle=MainClock.lastColorScored; + ctx.lineCap = "round"; + if (gameState === 0) { + ctx.strokeStyle = hexColorsToTintedColors[MainClock.lastColorScored]; + } else { + ctx.strokeStyle = MainClock.lastColorScored; + } ctx.lineWidth =4; var radius = (settings.rows * settings.blockHeight) * (2/Math.sqrt(3)) + settings.hexWidth + 2; var halfRadius = radius/2; var triHeight = radius *(Math.sqrt(3)/2); var Vertexes =[[halfRadius,triHeight],[radius,0],[halfRadius,-triHeight],[-halfRadius,-triHeight],[-radius,0],[-halfRadius,triHeight]].reverse(); - var startX =trueCanvas.width/2 + Vertexes[startVertex][0]; - var startY =trueCanvas.height/2 + Vertexes[startVertex][1]; + var startX =trueCanvas.width/2 + Vertexes[startVertex][0]; + var startY =trueCanvas.height/2 + Vertexes[startVertex][1]; var endX = trueCanvas.width/2 + Vertexes[endVertex][0]; var endY = trueCanvas.height/2 + Vertexes[endVertex][1]; ctx.moveTo(startX,startY); ctx.lineTo(((endX-startX)*fraction)+startX,((endY-startY)*fraction)+startY); - ctx.closePath() - ctx.fill() + ctx.closePath(); + ctx.fill(); ctx.stroke(); -} +} \ No newline at end of file diff --git a/js/main.js b/js/main.js index 09e086b..cc7aac4 100644 --- a/js/main.js +++ b/js/main.js @@ -4,10 +4,9 @@ $(document).ready(function(){ scaleCanvas(); $('#startBtn').on('touchstart mousedown', function(){ if (importing == 1) { - init(); + init(1); } - gameState = 1; setTimeout(function(){ document.body.addEventListener('mousedown', function(e) { handleClickTap(e.clientX); @@ -373,8 +372,8 @@ function isInfringing(clock){ function checkGameOver() { for (var i = 0; i < MainClock.sides; i++) { if (isInfringing(MainClock)) { - updateHighScore(); - gameOverDisplay(); + updateHighScore(); + gameOverDisplay(); return true; } }