-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path07-squarify.html
45 lines (39 loc) · 1.66 KB
/
07-squarify.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple Dungeon Squarified</title>
<link href="../unicodetiles/unicodetiles.css" rel="stylesheet" type="text/css" />
<link href="../docs/style.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="../unicodetiles/unicodetiles.js"></script>
<script src="../unicodetiles/ut.WebGLRenderer.js"></script>
<script src="../unicodetiles/ut.CanvasRenderer.js"></script>
<script src="../unicodetiles/ut.DOMRenderer.js"></script>
<script src="../unicodetiles/input.js"></script>
<script src="renderer-switcher.js"></script>
<!-- We are extending the simple-dungeon example -->
<script src="simple-dungeon.js"></script>
<script>
function squarify() {
// Squarify leaves gaps, so change the wall character
WALL = new ut.Tile('#', 100, 100, 100);
// Create new viewport with squarify enabled
term = new ut.Viewport(document.getElementById("game"), 25, 25, "auto", true);
// We also need to reset the engine since the viewport is new
// (because the simple-dungeon framework already initialized...)
eng = new ut.Engine(term, getDungeonTile, map[0].length, map.length);
}
</script>
</head>
<body onload="initSimpleDungeon(); squarify(); createRendererSwitcher();">
<p class="centerer">Move around with arrow keys.</p>
<div class="centerer">
<div id="game">Enable JavaScript and reload the page.</div>
</div>
<div class="centerer" id="renderer-switcher">
<!-- Populated by renderer-switcher.js -->
</div>
<a class="backlink" href="index.html"><-- Back to index</a>
</body>
</html>