-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
56 lines (48 loc) · 1.86 KB
/
index.html
File metadata and controls
56 lines (48 loc) · 1.86 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lab 2 - DOM</title>
<link rel="stylesheet" type="text/css" href="./css/game.css" media="all" />
<script src="game.js"></script>
<script>
var bear;
var bees;
var updateTimer;
var lastStingTime;
var started = false;
</script>
<noscript>
Warning - JavaScript is Disabled.
For full functionality of this page, it is necessary to enable JavaScript.
</noscript>
</head>
<body onload="start();">
<div id="title">
<h1>Help the bear escape the bees</h1>
<p>Bear tried to avoid being stung by <input type="text" id="nbBees" value="1" size="3"> bees by running and jumping. The objective is to have as less stings as possible!</p>
<p>You can adjust the bees' speed <input type="text" id="speedBees" value="10" size="3"> px/ms
<br><p>and the bear's speed <input type="text" id="speedBear" value="10" size="3"> px/ms
<br> and the refresh period <input type="text" id="periodTimer" value="10" size="3"> ms </p>
<h2>Press <kbd>left</kbd>, <kbd>right</kbd>, <kbd>up</kbd>, <kbd>down</kbd> keys to move the bear</h2>
<button onclick="addBee();">Add Bee</button>
</div>
<div id="scores">
<table>
<tr>
<td>
<p>Stings: [<span id="hits">0</span>]</p>
</td>
<td>
<p>Best duration: [<span id="duration">?</span>]</p>
</td>
</tr>
</table>
</div>
<div id="board">
<img src="./images/bear.gif" id="bear" alt="bear">
</div>
</body>
</html>