/* global noise */ /* TODO set opacity in RGB instead of SubTile */ var canvas; var ctx; var stop = false; var PartType = { UP: 0, RIGHT: 1, DOWN: 2, LEFT: 3, EMPTY: 4, FULL: 5 }; var a = 0; var tiles = []; var animspeed = 100; var animstep = 0; var step = 0; var steps = []; $(function() { a = Math.sqrt(Math.pow(document.body.clientWidth /19, 2)/3); canvas=document.getElementById("bg"); ctx = canvas.getContext("2d"); canvas.width = document.body.clientWidth; canvas.height = document.body.clientHeight - Math.floor(document.body.clientHeight%a) ; ctx.width = document.body.clientWidth ; // - document.body.clientWidth%19; ctx.height = document.body.clientHeight - (document.body.clientHeight%a) ; //ctx.fillStyle = "rgba(21, 21, 21, 100)"; ctx.fillStyle = '#00f'; //drawHexRect(ctx, 100, 10, 10); //var t = new Tile(100, 50, 50, ctx); //t.full(); //t.draw(); $('#bg').css('top', ((document.body.clientHeight%a)/2)); // - document.body.clientHeight%a; console.log(ctx.height + " " + a); console.log(Math.floor(canvas.height/a)); for(var x = 0; x<19; x++){ tiles[x] = []; for(var y = 0; y