User prompt
Update the snake movement logic to make the snake body follow the head
User prompt
reduce the speed of the snake by 90%
User prompt
reduce the speed of the snake by 90%
User prompt
Update the below movement for the snake head: When snake is asked to move right then first the snake head will move right and the snake body will follow the same path. This is applicable in other direction as well.
User prompt
snake will move never move in the opposite direction
User prompt
the snake body will always follow the path taken by the snake head
User prompt
the snake head and snake body are overlapped.. the snakebody is always connected to the opposite edge of the snake head
User prompt
reduce the snakes speed by 95%
User prompt
- Snake body will always be at the edge of the snake head - Snake body will follow the trail path of the snake head - The size of snake body will be equal of the snake head - The speed of the snake body will be same to the snake head
User prompt
snake head will always be in front and to the end of the snakehead the snake body is connected
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'head.x += head.x * 0.1;' Line Number: 129
User prompt
reduce the speed of the snakehead by 90% of it's current speed
User prompt
fix the snake not moving bug
User prompt
increase the speed of snake
User prompt
the speed of the snakehead will be the speed of the snake body
User prompt
Snake will never move in the opposite direction of it's head
User prompt
wherever the snakehead moves the body will follow the same trail and the control of the movement is to the head
User prompt
wherever the snakehead moves the body will follow the same trail.
User prompt
wherever the snakehead moves the body will follow the same trail and the control of the movement is to the head
User prompt
reduce the speed of the snake by 95% of it's current speed
User prompt
the snakebody will be connected to the edge of the snakehead and is visible too
User prompt
The snakebody is not visible, rectify the bug
User prompt
if the snake moves out of one edge make it appear back to screen from the opposite edge
User prompt
Reduce the speed of the snake by 97% of it's current speed
User prompt
Introduce a border to avoid snake leaving the screen
===================================================================
--- original.js
+++ change.js
@@ -115,8 +115,19 @@
}
}
game.update = function () {
snake.update();
+ var head = snake.segments[0];
+ if (head.x < 0) {
+ head.x = 2048;
+ } else if (head.x > 2048) {
+ head.x = 0;
+ }
+ if (head.y < 0) {
+ head.y = 2732;
+ } else if (head.y > 2732) {
+ head.y = 0;
+ }
for (var i = foods.length - 1; i >= 0; i--) {
if (snake.segments[0] && foods[i] && snake.segments[0].intersects(foods[i])) {
score += 10;
updateScore();
Apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Poisonous Skull. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pause icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
heart icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Snake Face. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Ostrich egg. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.