Skip to content

Commit 54dee48

Browse files
committed
first commit
0 parents  commit 54dee48

File tree

7 files changed

+1049
-0
lines changed

7 files changed

+1049
-0
lines changed

css/images/Thumbs.db

3.5 KB
Binary file not shown.

css/images/deadblock.png

240 Bytes
Loading

css/images/deadblock_border.png

117 Bytes
Loading

css/images/snakeblock.png

119 Bytes
Loading

css/snake.css

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
body {
2+
margin:0px;
3+
padding:0px;
4+
}
5+
6+
#game-area {
7+
margin:0px;
8+
padding:0px;
9+
}
10+
11+
#game-area:focus { outline: none; }
12+
13+
a.snake-link, a.snake-link:link, a.snake-link:visited {
14+
color: #FCFC54;
15+
}
16+
17+
a.snake-link:hover {
18+
color: #FfFf54;
19+
}
20+
21+
22+
.snake-panel-component {
23+
position: absolute;
24+
font-family: Verdana, arial, helvetica, sans-serif;
25+
font-size: 14px;
26+
color: #ffffff;
27+
text-align: center;
28+
background-color: #FC5454;
29+
padding: 8px;
30+
margin: 0px;
31+
}
32+
33+
.snake-snakebody-block {
34+
margin: 0px;
35+
padding: 0px;
36+
background-color: #FF0000;
37+
position: absolute;
38+
border: 0px solid #000080;
39+
background-repeat: no-repeat;
40+
}
41+
42+
.snake-snakebody-alive {
43+
background-image: url('./images/snakeblock.png');
44+
}
45+
.snake-snakebody-dead {
46+
background-image: url('./images/deadblock.png');
47+
}
48+
49+
.snake-food-block {
50+
margin: 0px;
51+
padding: 0px;
52+
background-color: #FF0000;
53+
border: 0px solid #000080;
54+
position: absolute;
55+
}
56+
57+
.snake-playing-field {
58+
margin: 0px;
59+
padding: 0px;
60+
position: absolute;
61+
background-color: #0000A8;
62+
border: 0px solid #0000A8;
63+
}
64+
65+
.snake-game-container {
66+
margin: 0px;
67+
padding: 0px;
68+
border-width: 0px;
69+
border-style: none;
70+
zoom: 1;
71+
background-color: #FC5454;
72+
position: relative;
73+
}
74+
75+
.snake-welcome-dialog {
76+
padding: 8px;
77+
margin: 0px;
78+
background-color: #000000;
79+
color: #ffffff;
80+
font-family: Verdana, arial, helvetica, sans-serif;
81+
font-size: 14px;
82+
position: absolute;
83+
top: 50%;
84+
left: 50%;
85+
width: 300px;
86+
height: 150px;
87+
margin-top: -100px;
88+
margin-left: -158px;
89+
text-align: center;
90+
display: block;
91+
}
92+
93+
.snake-try-again-dialog {
94+
padding: 8px;
95+
margin: 0px;
96+
background-color: #000000;
97+
color: #ffffff;
98+
font-family: Verdana, arial, helvetica, sans-serif;
99+
font-size: 14px;
100+
position: absolute;
101+
top: 50%;
102+
left: 50%;
103+
width: 300px;
104+
height: 100px;
105+
margin-top: -75px;
106+
margin-left: -158px;
107+
text-align: center;
108+
display: none;
109+
}

index.htm

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<!--
5+
6+
JavaScript Snake
7+
By Patrick Gillespie
8+
http://patorjk.com/games/snake
9+
10+
Terms of Re-Use:
11+
- If you're interested in using this app (which includes this file, patorjk.com/games/snake/snake.js and
12+
patorjk.com/games/snake/style.css) on your website, I give you permission as long as you link back to
13+
patorjk.com somewhere noticable in your application or on the website the app is hosted on.
14+
- As long as that condition is met, this app is free for you to build on and play around with.
15+
16+
-->
17+
<title>JavaScript Snake</title>
18+
<link rel="stylesheet" type="text/css" href="./css/snake.css" />
19+
</head>
20+
<body>
21+
<div id="game-area" tabindex="0">
22+
</div>
23+
<script type="text/javascript" src="./js/snake.js"></script>
24+
<script type="text/javascript">
25+
var mySnakeBoard = new SNAKE.Board( {
26+
boardContainer: "game-area",
27+
fullScreen: true
28+
});
29+
</script>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)