forked from MaciejKus/canvas_tower_defense
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
77 lines (77 loc) · 2.08 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
<!DOCTYPE html>
<html>
<head>
<title>HTML5/Canvas/Javascript tower defense game</title>
<meta name="description" content="A tower defense game made with JavaScript and Canvas.">
<style>
.right {
float:right;
}
.canvas {
float:left;
margin-right: 10px;
background:url(tower_background.png);
}
.tower {
display:inline-block;
padding: 5px;
border: 1px solid;
}
</style>
</head>
<body>
<canvas id='canvas' class='canvas' width='600' height='600' style='border:1px solid #000;'>Looks like HTML% canvas is turned off. Sorry, this tower defense game needs canvas to work</canvas>
<div style="display:none;">
<img id="tower1img" src="tower1.png" width="40" height="40">
<img id="tower2img" src="tower2.png" width="40" height="40">
<img id="tower3img" src="tower3.png" width="40" height="40">
</div>
<div class='tower' style='background-color: green;' onclick='changeTower(0);'>
Tower 1
<br>
Range: <span id='tower1range'></span>
<br>
Damage: <span id='tower1damage'></span>
<br>
Rate: <span id='tower1rate'></span>
<br>
Cost: <span id='tower1cost'></span>
</div>
<p>
<div class='tower' style='background-color: brown;' onclick='changeTower(1);'>
Tower 2
<br>
Range: <span id='tower2range'></span>
<br>
Damage: <span id='tower2damage'></span>
<br>
Rate: <span id='tower2rate'></span>
<br>
Cost: <span id='tower2cost'></span>
</div>
<p>
<div class='tower' style='background-color:aqua;' onclick='changeTower(2);'>
Tower 3
<br>
Range: <span id='tower3range'></span>
<br>
Damage: <span id='tower3damage'></span>
<br>
Rate: <span id='tower3rate'></span>
<br>
Cost: <span id='tower3cost'></span>
</div>
<br>
<div style='width:600px;'>
Attackers Score: <span id='attackersScore'>0</span>
<span class='right'>Money: <span id='money'>250</span></span>
<br>
Attackers Stopped: <span id='stopped'>0</span>
</div>
<script type='text/javascript' src='mainLoop.js'></script>
<script type='text/javascript' src='attackerUnits.js'></script>
<script type='text/javascript' src='towerUnits.js'></script>
<script type='text/javascript' src='bullets.js'></script>
<script type='text/javascript' src='mouseClick.js'></script>
</body>
</html>