combo lines now match the faded blocks during menu screen play
This commit is contained in:
parent
57b6f21e89
commit
71dd048738
2 changed files with 14 additions and 11 deletions
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue