-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (98 loc) · 2.9 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snake Feast</title>
<link rel="icon" href="ios/32.png" type="image/png">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="manifest" href="manifest.json">
<script type="text/javascript">
var c;
var ctx;
function init(){
c = document.getElementById("myCanvas");
ctx = c.getContext("2d");
draw();
}
function draw(){
setInterval(function(){
ctx.fillStyle="black";
ctx.fillRect(0,0,c.width,c.height);
ctx.fillStyle="blue";
ctx.beginPath();
ctx.arc(15,11,10,0,Math.PI*2);
ctx.fill();
ctx.fillStyle="red";
ctx.beginPath();
ctx.arc(15,35,10,0,Math.PI*2);
ctx.fill()
ctx.font = "15pt Arial"
// Gradient
var gradient = ctx.createLinearGradient(0,0,c.width,0);
gradient.addColorStop("0","red");
gradient.addColorStop("1","blue");
ctx.fillStyle=gradient;
ctx.fillText(" 1 Point",27,20);
ctx.fillText(" 5 Point",28,45);
},30);
}
</script>
</head>
<body onload="init()">
<div class="container">
<div id="start-overlay">
<h1 id="snake-game">SNAKE FEAST</h1>
<a href="#">Click To Start Game</a>
</div>
<div id="overlay" >
<h1 id="snake-game">SNAKE FEAST</h1>
Your Final Score: <span id="final_score"></span>
<br>
<a href="#">Click To Play Again</a>
</div>
<canvas id="canvas" width="1350" height="550">
Sorry This Browser does not support Canvas
</canvas>
<div id="stats">
<div id="score">Your Score: 0</div>
<div id="high_score">High Score:</div>
<button onclick="resetScore()" id="reset_score">Reset High Score</button>
</div>
<div class="dropdown">
<button class="dropbtn">Snake Color</button>
<div class="dropdown-content" id ="color-options">
<li data-color="green">Green</li>
<li data-color="red">Red</li>
<li data-color="blue">Blue</li>
<li data-color="white">White</li>
<li data-color="black">Black</li>
<!-- <li data-color="white">White</li>
<li data-color="yellow">Yellow</li>
<li data-color="purple">Purple</li>-->
</div>
</div>
<div class="Start">
<button class="Start-Btn">Start Game</button>
</div>
<div id="difficulty">
<button id="diff-btn">Select Mode</button>
<div id="diff-option">
<li id="easy">Easy</li>
<li id="medium">Medium</li>
<li id="hard">Hard</li>
</div>
</div>
<br>
<canvas id="myCanvas" width="110" height="50">
<p>Sorry this browser does not support canvas</p>
</canvas>
</div>
<!-- JQuery -->
<script src="jquery.min.js"></script>
<!-- Main js -->
<script type="text/javascript" src="script.js"></script>
<!-- Include QWebChannel script -->
<script src="qwebchannel.js"></script>
</body>
</html>