diff --git a/index.html b/index.html index fde60ec..d350688 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,6 @@ var _COLOR_GRASS = '#388E3C', }) }) - // var i = 0 function animLoop() { ctx.clearRect(0, 0, $('canvas').width(), $('canvas').height()); @@ -130,12 +129,6 @@ var _COLOR_GRASS = '#388E3C', ctx.fillStyle = _COLOR_BALL ctx.fill() ctx.closePath() - //DEBUG - ctx.beginPath() - ctx.arc(x, y, 1, 0, Math.PI*2) - ctx.fillStyle = 'black' - ctx.fill() - ctx.closePath() } function drawBracket() { @@ -159,20 +152,6 @@ var _COLOR_GRASS = '#388E3C', function collide() { var coll = [false, false, false, false] //left, top, right, bottom borders.forEach(function(el){ - // if(bX >= el.x && bX <= el.x+el.width && bY >= el.y && bY <= el.y+el.height){ - // drawDebugBorder(el) - // if(Math.round(bX) == el.x || Math.round(bX) == el.x+el.width){ - // bVec = [-bVec[0], bVec[1]] - // } - // else if(Math.round(bY) == el.y || Math.round(bY) == el.y+el.height) - // bVec = [bVec[0], -bVec[1]] - // else { - // console.error('Error during collide()') - // console.log(el) - // console.log(Math.round(bY)); - // console.log(Math.round(bX)); - // } - // } var dx = (el.x+el.width/2)-(bX+bWidth/2) var dy = (el.y+el.height/2)-(bY+bWidth/2) var width = (el.width+bWidth)/2 @@ -211,12 +190,6 @@ var _COLOR_GRASS = '#388E3C', console.log('bottom > 0'); bVec = [bVec[0], -Math.abs(bVec[1])] } - - - if($.inArray(true, coll) > -1){ - console.log(coll) - console.log(bVec); - } } /** CLASSES **/