This repository has been archived by the owner on Dec 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
/
index.html
107 lines (103 loc) · 4.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="Amelia Clarke">
<title>Tower Defense</title>
<link href="style.css" rel="stylesheet">
<script src="scripts/lib/lz-string.min.js" defer></script>
<script src="scripts/lib/p5.min.js" defer></script>
<script src="scripts/lib/p5.sound.min.js" defer></script>
<script src="scripts/utils.js" defer></script>
<script src="scripts/enemy.js" defer></script>
<script src="scripts/enemies.js" defer></script>
<script src="scripts/particle.js" defer></script>
<script src="scripts/particle_system.js" defer></script>
<script src="scripts/effect.js" defer></script>
<script src="scripts/effects.js" defer></script>
<script src="scripts/tower.js" defer></script>
<script src="scripts/towers.js" defer></script>
<script src="scripts/missile.js" defer></script>
<script src="scripts/maps.js" defer></script>
<script src="scripts/tiles.js" defer></script>
<script src="scripts/sketch.js" defer></script>
</head>
<body>
<header>
<h1>Tower Defense</h1>
</header>
<main>
<div id="left-asides">
<aside id="map-aside">
<div class="group">
<p><button class="io" onclick="importMap(prompt('Input map string:'))">Import map (M)</button></p>
<p><button class="io" onclick="copyToClipboard(exportMap())">Export map (X)</button></p>
</div>
<p>Edit maps <a href="https://rsaihe.github.io/td-editor/" target="_blank">here</a>.</p>
</aside>
<aside id="store">
<h2>Store</h2>
<div class="group">
<p><button class="gun" onclick="setPlace('gun')">Gun Tower (1)</button></p>
<p><button class="laser" onclick="setPlace('laser')">Laser Tower (2)</button></p>
<p><button class="slow" onclick="setPlace('slow')">Slow Tower (3)</button></p>
<p><button class="sniper" onclick="setPlace('sniper')">Sniper Tower (4)</button></p>
<p><button class="rocket" onclick="setPlace('rocket')">Rocket Tower (5)</button></p>
<p><button class="bomb" onclick="setPlace('bomb')">Bomb Tower (6)</button></p>
<p><button class="tesla" onclick="setPlace('tesla')">Tesla Coil (7)</button></p>
</div>
</aside>
</div>
<div id="sketch-holder"></div>
<div id="right-asides">
<aside id="status">
<p id="wave"></p>
<p id="health"></p>
<p id="cash"></p>
<div class="horiz-buttons">
<button id="pause" onclick="pause()">Start</button>
<button onclick="resetGame()">Restart</button>
</div>
<p>
Map:
<select id="map">
<option value="empty2">Empty (2)</option>
<option value="empty3">Empty (3)</option>
<option value="sparse2" selected>Sparse (2)</option>
<option value="sparse3">Sparse (3)</option>
<option value="dense2">Dense (2)</option>
<option value="dense3">Dense (3)</option>
<option value="solid2">Solid (2)</option>
<option value="solid3">Solid (3)</option>
<option id="custom" value="custom">Custom</option>
<option value="loops">Loops</option>
<option value="spiral">Spiral</option>
<option value="branch">Branch</option>
<option value="branchAlt">Branch (Alt)</option>
<option value="city">City</option>
<option value="freeway">Freeway</option>
<option value="walls">Walls</option>
<option value="fork">Fork</option>
</select>
</p>
</aside>
<aside id="info">
<div id="info-div">
<h3 id="name"></h3>
<p id="cost"></p>
<p id="sellPrice"></p>
<p id="upPrice"></p>
<p id="damage"></p>
<p id="type"></p>
<p id="range"></p>
<p id="cooldown"></p>
<div class="horiz-buttons" id="info-buttons">
<button id="sell" onclick="if (selected) sell(selected)">Sell</button>
<button id="upgrade" onclick="if (selected && selected.upgrades.length > 0) upgrade(selected.upgrades[0])">Upgrade</button>
</div>
</div>
</aside>
</div>
</main>
</body>
</html>