From ecfa19482f9c8803db75f438b3e2db1d328fef77 Mon Sep 17 00:00:00 2001 From: Ankit Date: Mon, 19 Aug 2019 18:01:38 +0530 Subject: [PATCH] snake will never die --- snake.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snake.html b/snake.html index 512dc99..3e3d999 100644 --- a/snake.html +++ b/snake.html @@ -98,7 +98,7 @@ context.fillRect(apple.x, apple.y, grid-1, grid-1); // draw snake one cell at a time - context.fillStyle = 'red'; + context.fillStyle = 'white'; snake.cells.forEach(function(cell, index) { // drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is @@ -113,7 +113,7 @@ apple.y = getRandomInt(0, 25) * grid; } - // check collision with all cells after this one (modified bubble sort) + /* // check collision with all cells after this one (modified bubble sort) for (var i = index + 1; i < snake.cells.length; i++) { // snake occupies same space as a body part. reset game @@ -128,7 +128,7 @@ apple.x = getRandomInt(0, 25) * grid; apple.y = getRandomInt(0, 25) * grid; } - } + }*/ }); }