User prompt
No red screen
User prompt
No red screen
User prompt
If the snake touch the wall don't end game
User prompt
When the snake touch dot it size increase
User prompt
Snake can move Left Right as user wants
User prompt
Snake can move Left Right as user wants
User prompt
Snake move where the user wants
User prompt
No game over
Initial prompt
Snake
===================================================================
--- original.js
+++ change.js
@@ -131,9 +131,9 @@
// Update game logic
game.update = function () {
snake.update();
// Check for collision with food
- if (snake.body[0].x === food.x && snake.body[0].y === food.y) {
+ if (Math.abs(snake.body[0].x - food.x) < 50 && Math.abs(snake.body[0].y - food.y) < 50) {
snake.grow();
food.randomizePosition();
score++;
scoreTxt.setText(score);