You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01d1a17
Browse filesBrowse the repository at this point in the historyBrowse files
On first load sometimes the game frame will not load correctly and you'll need to press the refresh icon above its display panel to get the game to show.
12
+
13
+
Original game is located here:
14
+
4
15
http://patorjk.com/games/snake
5
16
6
-
This is a DOM-based game of Snake that I wrote in JavaScript a few years back.
7
17
8
-
Other than the full screen mode demonstrated in the code, it can also be
9
-
initialized in div tags within a page. Example:
18
+
## How to use
19
+
The index.html file should give an idea of how to use this code. However, below you can see how to initialize it into any div within a webpage.
10
20
11
21
var mySnakeBoard = new SNAKE.Board( {
12
22
boardContainer: "game-area",
@@ -15,5 +25,4 @@ initialized in div tags within a page. Example:
15
25
height:400
16
26
});
17
27
18
-
The comments are formatted a little strange because at the time I was playing
19
-
around with YUI Doc.
28
+
The comments within the source code are formatted a little strange because at the time I was playing around with YUI Doc which generates documentation from code. Kind of sucks that there's so much churn in the JavaScript world. However, I'm glad the rest of the code doesn't use any external libraries, as this game still works the same after over a decade.
0 commit comments