User prompt
delete the snake
User prompt
add a background for this game..
User prompt
Add a canvas screen to the game
User prompt
Now allow the snake to enter in the right border and come back from the left border, and same is applied to the up and down direction
User prompt
restrict the snake from moving in random direction, only direction the snake can move is up, down, left, right.
User prompt
when the pause icon is clicked the snake should stop moving and the snake should not shift it's path
User prompt
the pause is not working properly
User prompt
give a pause icon to stop the game
User prompt
add a snake head to the current snakesegment and the snake head will always stay in the front as a lead
User prompt
make the snake to move in the direction of click
User prompt
make the snake go only in vertical and horizontal position
User prompt
- If snake enters left border make it appear right border and vice versa - If snake enters upper border make it appear from the bottom border and vice versa
User prompt
Remove the border
User prompt
the snake body is not connected to the end of the head
User prompt
add a snakes head in the first box, and body connect to the end of the first box
User prompt
restrict the snake from moving in a random diagonal direction
User prompt
The snake should represented as follows Head (first box), body (second box, and so on (which increases after eating the food)
User prompt
the current snakesegment should have 2 parts 1. Head 2. Body - whose length keeps on increasing after eating a food
User prompt
after the snake head the next thing its should have is a body segment whose size increases after eating the food
User prompt
Give a head to the snake
User prompt
fix the sound bug for gameover
User prompt
fix the sound bug for the lives
User prompt
remove that transition effect from the snake
User prompt
Fix the position of the snake face and for each food eaten by snake increase the length of snake by the trail of the color of the snake
User prompt
first cube of the snake should be the snake face and the food eaten will increase the length of the body of the snake so the continuation of the image should be limited to the face
===================================================================
--- original.js
+++ change.js
@@ -62,16 +62,18 @@
var newHead = {
x: self.segments[0].x + self.direction.x * self.speed,
y: self.segments[0].y + self.direction.y * self.speed
};
- if (newHead.x < 0 || newHead.x > 2048 || newHead.y < 0 || newHead.y > 2732) {
- self.direction.x *= -1;
- self.direction.y *= -1;
- newHead = {
- x: self.segments[0].x + self.direction.x * self.speed,
- y: self.segments[0].y + self.direction.y * self.speed
- };
+ if (newHead.x < 0) {
+ newHead.x = 2048;
+ } else if (newHead.x > 2048) {
+ newHead.x = 0;
}
+ if (newHead.y < 0) {
+ newHead.y = 2732;
+ } else if (newHead.y > 2732) {
+ newHead.y = 0;
+ }
if (self.grow) {
var newSegment = self.attachAsset('snakeSegment', {
anchorX: 0.5,
anchorY: 0.5
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.