combo lines now match the faded blocks during menu screen play

This commit is contained in:
meadowstream 2014-06-27 22:09:36 -04:00
parent 6f731d8598
commit 54a4759b9c
2 changed files with 14 additions and 11 deletions

View file

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

View file

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