-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (58 loc) · 2.35 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
<!DOCTYPE html>
<html>
<head>
<title>Dungeon5e</title>
<link rel="stylesheet" type="text/css" href="css/core.css">
</head>
<body>
<script src="js/random.js"></script>
<script src="js/prototypes/array.js"></script>
<script src="http://tageverything.org/js/jquery.js"></script>
<script src="js/enums.js"></script>
<script src="js/data/door.js"></script>
<script src="js/data/entrance.js"></script>
<script src="js/data/chamber.js"></script>
<script src="js/tile/type.js"></script>
<script src="js/tile/base.js"></script>
<script src="js/tile/floor.js"></script>
<script src="js/tile/wall.js"></script>
<script src="js/tile/door.js"></script>
<script src="js/tile/entrance.js"></script>
<script src="js/section/base.js"></script>
<script src="js/section/entrance.js"></script>
<script src="js/section/chamber.js"></script>
<script src="js/map.js"></script>
<script src="js/generator.js"></script>
<h2>Dungeon5e</h2>
<h3>D&D 5th Edition Dungeon Generator</h3>
Width <input type="text" width="30" id="MapWidth" value="80"><br>
Height <input type="text" width="30" id="MapHeight" value="25"><br>
<button id="genButton" >Generate</button> <button id="stopGenButton">Stop</button>
<br>
<blockquote class="monospace pre" id="map"></blockquote>
<blockquote class="monospace">
Legend
@ = Starting position
X = Door
# = Wall
. = Unknown
</blockquote>
<script>
$(function(){
var gen = function(){
var width = parseInt($('#MapWidth').get(0).value);
var height = parseInt($('#MapHeight').get(0).value);
if(typeof(width)!="number" || isNaN(width)==true)
width=120;
if(typeof(height)!="number" || isNaN(height)==true)
height=30;
var map = Generator.generateMap(height,width);
$('#map').html(map.renderAscii());
};
$('#genButton').get(0).onclick = function(){gen()};
$('#stopGenButton').get(0).onclick = function(){Generator.stopGenerating();};
gen();
});
</script>
</body>
</html>