diff --git a/anthony_hernandez/end_of_video_code.html b/anthony_hernandez/end_of_video_code.html index 3330afb3..77d62ab1 100644 --- a/anthony_hernandez/end_of_video_code.html +++ b/anthony_hernandez/end_of_video_code.html @@ -119,9 +119,11 @@ } if(ballY < 0) { ballSpeedY = -ballSpeedY; + console.log("test2") } if(ballY > canvas.height) { ballSpeedY = -ballSpeedY; + console.log("TEst"); } } @@ -163,11 +165,23 @@ canvasContext.fillText(player2Score, canvas.width-100, 100); } +function generateRandomColorValue() +{ + return Math.floor(Math.random() * 256); +} + function colorCircle(centerX, centerY, radius, drawColor) { canvasContext.fillStyle = drawColor; canvasContext.beginPath(); canvasContext.arc(centerX, centerY, radius, 0,Math.PI*2,true); + let r = generateRandomColorValue(); + let g = generateRandomColorValue(); + let b = generateRandomColorValue(); + let rgbColor = "rgb(" + r + "," + g + "," + b +")"; + console.log(rgbColor); + canvasContext.fillStyle = rgbColor; canvasContext.fill(); + canvasContext.fillStyle = "white"; } function colorRect(leftX,topY, width,height, drawColor) {