Skip to content

Commit b563165

Browse files
Merge pull request #3 from Computerkrack/main
Local Storage working again
2 parents 7950e7a + 156b54c commit b563165

17 files changed

+8
-7
lines changed

images/Snake-Graphics/apple.webp

1.63 KB
Binary file not shown.
994 Bytes
Binary file not shown.
972 Bytes
Binary file not shown.
988 Bytes
Binary file not shown.
1.01 KB
Binary file not shown.

images/Snake-Graphics/head down.webp

1.41 KB
Binary file not shown.

images/Snake-Graphics/head left.webp

1.35 KB
Binary file not shown.

images/Snake-Graphics/head right.webp

1.34 KB
Binary file not shown.

images/Snake-Graphics/head up.webp

1.41 KB
Binary file not shown.
360 Bytes
Binary file not shown.
370 Bytes
Binary file not shown.

images/Snake-Graphics/tail down.webp

1.07 KB
Binary file not shown.

images/Snake-Graphics/tail left.webp

1.01 KB
Binary file not shown.

images/Snake-Graphics/tail right.webp

1.02 KB
Binary file not shown.

images/Snake-Graphics/tail up.webp

1.06 KB
Binary file not shown.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<title>Snake</title>
9-
<link rel="shortcut icon" href="images/favicon-256x256.png">
9+
<link rel="icon" type="image/x-icon" href="/images/favicon-256x256.png">
1010
<link rel="stylesheet" href="snake.css">
1111
</head>
1212
<body>

snake.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// ---- temp only for development ----
2-
let temp;
3-
temp = '!!temp42!!';
4-
// ---- JS ----
1+
// ----- temp only for development -----
2+
let temp = '!!temp42!!';
3+
// ----- JS ----- //
54
let board;
65
let blockSize = 25 % screen.height;
76
let rows = 20;
@@ -17,12 +16,13 @@ let snakeBody = [];
1716
let gameOver = false;
1817
let gameRunning = false;
1918
let recentGame = [];
19+
2020
let allRecentGamesArr = [];
2121
let highScoreArr = [0,0,0,0];
2222
let newHighScoreWritten = false;
2323

2424

25-
// ----- from/for HTML ----
25+
// ----- from/for HTML -----
2626
let liveScore = document.getElementById("score");
2727
let newScore = 0;
2828
let liveSeconds = document.getElementById("seconds");
@@ -49,6 +49,7 @@ let highLength = undefined;
4949
let highColected = undefined;
5050
let LSClearButton = document.getElementById("clearLSButton");
5151

52+
5253
// --------------------------- End of Variables -------------------------------------------------------------
5354

5455
liveScore.innerHTML = '0';
@@ -82,7 +83,7 @@ function restart() {
8283
}
8384

8485
function start () {
85-
localStorageReader();
86+
//localStorageReader();
8687
updateHighScore();
8788
for (let i = 0; i < allRecentGamesArr.length; i++) {
8889
recentGamesTableWriter(i);

0 commit comments

Comments
 (0)