Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c1cca8

Browse files
committed
fixed initial state head color
1 parent 53bfdbe commit 2c1cca8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

js/snake.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,11 @@ SNAKE.Snake = SNAKE.Snake || (function() {
333333

334334
newHead.elmStyle.left = newHead.xPos + "px";
335335
newHead.elmStyle.top = newHead.yPos + "px";
336-
newHead.elm.id="snake-snakehead-alive";
337-
oldHead.elm.id = "";
336+
if(me.snakeLength>1){
337+
newHead.elm.id="snake-snakehead-alive";
338+
oldHead.elm.id = "";
339+
}
340+
338341

339342

340343
// check the new spot the snake moved into

0 commit comments

Comments
 (0)