-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnakeGame.html
97 lines (67 loc) · 3.05 KB
/
snakeGame.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Assignment 2 - Snake Canvas Game</title>
<link rel="stylesheet" href="css/snake.css" />
<link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans:600' rel='stylesheet' type='text/css'>
</head>
<body>
<section id="page">
<header>
<h1>Snake Game in Canvas</h1>
</header>
<span id="scoreBoard" style="font-size:x-large;"></span>
<span id="highScore" style="font-size:x-large;color:red;display:none;"> ...New High Score!!!...</span>
<section id="layers">
<canvas id="bg" width="760" height="440">
Sorry, your web browser does not support canvas content.
</canvas>
<canvas id="game" width="760" height="440"></canvas>
<canvas id="ui" width="760" height="440"></canvas>
<div id="menu">
<h1 id="snake">Snake Game</h1>
<p id="info">by Jagraj Singh</p>
<a href="javascript: void(0)" id="start" >Start</a>
<p>
<marquee direction="right"><img src="images/snake.gif" alt="snake_image"/>
<img src="images/frog.gif" alt="frog_image" width="80" height="80"/>
</marquee>
</p>
</div>
<div id="reMenu" style="display:none;">
<h1 id="snake2">Snake Game</h1>
<p id="info2">Game Over</p>
<a href="javascript: void(0)" id="restart" >Restart</a>
<a href="#" id="tweet" target="_blank" rel="nofollow">Tweet My Score</a>
</div>
</section>
<p>
<span style="color:red;">Instructions :</span>
<span id="bottom_msg" style="display:none;"> Bonus Food Available!!! Hurry up!!!
<span id="food_timer">15</span> seconds left...
</span>
</p>
<footer>
<p>@Copyrights JAGRAJ SINGH 300781914 WEB GAME PROGRAMMING</p>
</footer>
</section>
<audio id="start_music" loop>
<source src="sounds/killingsound.mp3" type="audio/mp3" />
</audio>
<audio id="main_music" loop>
<source src="sounds/backsound.wav" type="audio/wav" />
</audio>
<div id="powerUpBoard" style="position:absolute;left:2%;top:20%;border:5px groove green;width:12%;height:18%;display:none;">
<div style="text-align:center;font-size:x-large;font-weight:600;">Level : <span id="levelNum">1</span></div>
<div style="text-align:center;font-size:x-large;font-weight:600;">Power Up</div>
<img id="life1" src="images/star1.png" width="30%" height="42%" style="display:none;"/>
<img id="life2" src="images/star1.png" width="30%" height="42%" style="display:none;"/>
<img id="life3" src="images/star1.png" width="30%" height="42%" style="display:none;"/>
</div>
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>-->
<script src="js/jquery-1.4.3.js"></script>
<script src="js/snake.js"></script>
</body>
</html>