Merge branch 'master' into gh-pages

This commit is contained in:
meadowstream 2014-05-21 17:39:49 -04:00
commit 5cc9210781
3 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@
<h1 style="color: #ecf0f1; font-size: 10vmin;">Hextris</h1>
</div>
<canvas id="canvas" width="800" height="800" style="position: absolute; left: calc(50% - 80vmin / 2); height: 80vmin; width: 80vmin; background-color: rgba(0,0,0,0);"></canvas>
<canvas id="canvas" width="800" height="800" style="position: absolute; left: calc(50% - 80vmin / 2); height: 80vmin; width: 80vmin; background: -webkit-radial-gradient(#2980b9 35%,rgba(44,62,80,50) 68%);"></canvas>
<div id="leftTap" style="position: absolute; left: 0; top: 0; height: 100%; width: 50%;"></div>
<div id="rightTap" style="position: absolute; right: 0; top: 0; height :100%; width: 50%;"></div>

View file

@ -3,6 +3,7 @@ var ctx = canvas.getContext('2d');
ctx.translate(0.5, 0.5);
canvas.originalHeight = canvas.height;
canvas.originalWidth = canvas.width;
if (window.devicePixelRatio) {
canvas.width *= window.devicePixelRatio;
canvas.height *= window.devicePixelRatio;
@ -95,8 +96,7 @@ function update() {
}
function render() {
// document.getElementById("score").innerHTML =;
document.getElementById("score").innerHTML = score + " (x" + scoreScalar * scoreAdditionCoeff + ")";
ctx.clearRect(0, 0, canvas.originalWidth, canvas.originalHeight);
clearGameBoard();

View file

@ -43,10 +43,10 @@ function clearShadows() {
}
function clearGameBoard() {
ctx.shadowColor = '#2980b9';
//ctx.shadowBlur = 25;
// ctx.shadowColor = '#2980b9';
// ctx.shadowBlur = 25;
drawPolygon(canvas.originalWidth / 2, canvas.originalHeight / 2, 6, canvas.originalWidth / 2 - 25, 30, hexagonBackgroundColor);
clearShadows();
// clearShadows();
}
function drawPolygon(x, y, sides, radius, theta, color, fill) { // can make more elegant, reduce redundancy, fix readability