-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex4.html
executable file
·120 lines (106 loc) · 8.08 KB
/
index4.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
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>wayFinding</title>
<style>
* {
padding: 0px;
margin: 0px;
font-size: 12px;
}
.container {
display: none;
overflow: hidden;
margin: 30px;
width: 489px;
border-bottom: 1px gray solid;
border-right: 1px gray solid;
}
.container ul {
width: 100%;
clear: both;
}
li {
width: 5px;
height: 5px;
float: left;
list-style: none;
border-left: 1px gray solid;
border-top: 1px gray solid;
position: relative;
}
.start,.end {
//font-size:38px;
font-weight: bold;
}
.start {
background: red;
}
.end {
background: green;
}
.npc {
background: #2b3b46;
}
.f, .g, .h {
position: absolute;
}
.f {
color: blue;
left: 8px;
top: 8px;
}
.g {
left: 8px;
bottom: 8px;
}
.h {
right: 8px;
bottom: 8px;
}
</style>
</head>
<body>
<div class="container"></div>
<button id=run style="clear: both;">寻路</button>
<script src="./src/jquery.js"></script>
<script src="./src/index.js"></script>
<script>
var w = new WayFinding({
isShowInfo: false,
rows: 80,
cols: 80,
start: [4,0],
end: [74,6],
roadblock: function() {
var arr = [[79,0],[78,0],[19,0],[19,1],[18,1],[18,2],[18,3],[18,4],[17,5],[17,6],[17,7],[16,7],[16,8],[16,9],[16,10],[16,11],[16,12],[15,12],[15,13],[15,14],[15,15],[14,15],[14,16],[14,17],[14,18],[13,18],[13,19],[13,20],[13,21],[13,22],[13,23],[12,23],[12,24],[11,25],[11,26],[10,26],[10,27],[10,28],[10,29],[10,30],[10,31],[10,32],[9,32],[9,33],[9,34],[9,35],[9,36],[9,37],[9,38],[9,39],[9,40],[9,41],[9,42],[9,43],[9,44],[10,45],[10,46],[10,47],[10,48],[10,49],[11,49],[11,50],[12,50],[12,51],[13,51],[13,52],[14,52],[14,53],[15,53],[15,54],[16,54],[17,54],[18,54],[18,55],[19,55],[20,55],[20,56],[21,56],[22,56],[23,56],[23,57],[24,57],[23,57],[22,57],[22,56],[21,56],[20,56],[19,56],[19,55],[18,55],[17,55],[17,54],[16,54],[16,53],[15,53],[15,52],[14,52],[14,51],[13,51],[13,50],[12,50],[12,49],[12,48],[11,48],[11,47],[11,46],[10,46],[10,45],[9,45],[9,44],[9,43],[9,44],[9,45],[9,46],[10,46],[10,47],[10,48],[11,48],[11,49],[12,49],[12,50],[13,50],[13,51],[14,51],[15,51],[15,52],[16,52],[17,52],[18,52],[18,53],[19,53],[19,54],[20,54],[20,55],[21,55],[22,56],[23,56],[24,56],[25,56],[26,56],[26,57],[27,57],[28,57],[29,57],[30,57],[31,57],[32,57],[33,57],[33,56],[34,56],[34,55],[35,55],[35,54],[36,54],[36,53],[37,53],[37,52],[38,52],[38,51],[39,51],[39,50],[40,50],[40,49],[41,49],[41,48],[41,47],[41,46],[42,46],[42,45],[42,44],[42,43],[43,43],[43,42],[43,41],[44,41],[44,40],[44,39],[45,39],[45,38],[45,37],[45,36],[45,35],[45,34],[45,33],[45,32],[45,31],[45,30],[45,29],[45,28],[45,27],[45,26],[45,25],[45,24],[45,23],[45,22],[44,22],[44,21],[44,20],[44,19],[43,19],[43,18],[42,18],[42,17],[41,17],[41,16],[40,16],[39,16],[38,16],[37,16],[37,15],[36,15],[35,15],[35,16],[34,16],[33,16],[33,17],[32,17],[32,18],[32,19],[31,19],[31,20],[31,21],[30,21],[30,22],[29,22],[29,23],[28,23],[28,24],[28,25],[28,26],[27,26],[27,27],[27,28],[27,29],[27,30],[27,31],[27,32],[27,33],[27,34],[27,35],[27,36],[27,37],[28,37],[28,36],[28,35],[28,34],[28,33],[28,32],[28,31],[28,30],[28,29],[28,28],[28,27],[28,26],[28,25],[28,24],[28,23],[28,22],[29,22],[29,21],[30,21],[30,20],[31,20],[31,19],[32,19],[32,18],[32,17],[33,17],[34,17],[35,17],[35,16],[36,16],[37,16],[38,16],[39,16],[40,16],[40,17],[41,17],[41,18],[42,18],[42,19],[43,19],[43,20],[43,21],[44,21],[44,22],[44,23],[44,24],[44,25],[45,25],[45,26],[45,27],[45,28],[45,29],[45,30],[45,31],[45,32],[45,33],[45,34],[45,35],[44,35],[44,36],[44,37],[44,38],[44,39],[44,38],[44,37],[43,37],[44,38],[43,38],[44,38],[45,38],[46,38],[55,39],[54,76],[55,74],[55,73],[55,71],[56,70],[56,69],[56,68],[57,66],[57,65],[57,63],[58,60],[58,58],[59,56],[59,53],[59,51],[59,49],[59,47],[59,45],[59,43],[59,40],[59,38],[59,36],[59,34],[59,32],[59,31],[59,29],[59,28],[59,27],[59,25],[59,24],[58,23],[58,22],[58,21],[58,20],[57,20],[57,19],[56,18],[55,17],[55,16],[54,16],[54,15],[53,14],[53,13],[52,13],[52,12],[51,12],[51,11],[50,11],[50,10],[49,10],[48,10],[48,9],[47,9],[46,9],[45,9],[44,8],[43,8],[42,8],[41,8],[40,8],[39,8],[40,8],[41,8],[42,8],[43,8],[43,9],[44,9],[45,9],[46,9],[47,9],[47,10],[48,10],[49,10],[49,11],[50,11],[51,12],[52,12],[52,13],[53,13],[53,14],[54,14],[54,15],[54,16],[55,16],[55,17],[56,17],[56,18],[56,19],[57,19],[57,20],[57,21],[57,22],[58,22],[58,23],[58,24],[59,24],[59,25],[59,26],[59,27],[59,26],[59,27],[59,28],[59,29],[59,30],[59,31],[59,32],[59,33],[60,33],[60,34],[60,35],[60,36],[60,37],[60,38],[60,39],[60,40],[60,41],[59,41],[59,42],[59,43],[59,44],[59,45],[59,46],[59,45],[59,44],[59,43],[59,42],[59,41],[59,40],[59,39],[59,38],[59,37],[59,38],[59,39],[59,40],[59,41],[59,42],[59,43],[59,44],[59,45],[59,46],[59,47],[59,48],[59,49],[59,50],[59,51],[59,52],[59,53],[59,54],[59,55],[59,56],[59,57],[58,57],[58,58],[58,59],[58,58],[58,57],[58,56],[58,57],[58,58],[58,59],[58,60],[58,61],[58,62],[57,62],[57,63],[57,64],[57,65],[57,66],[57,67],[57,68],[57,69],[56,69],[56,70],[56,71],[56,72],[55,72],[55,73],[55,74],[55,75],[54,75],[54,76],[61,0],[62,0],[62,1],[62,2],[62,3],[62,4],[63,4],[63,5],[63,6],[64,6],[64,7],[64,8],[64,9],[65,9],[65,10],[65,11],[65,12],[66,12],[66,13],[66,14],[66,15],[67,15],[67,16],[67,17],[67,18],[66,19],[66,20],[66,21],[66,22],[66,23],[66,24],[66,25],[66,26],[66,27],[66,28],[66,29],[66,30],[66,31],[66,32],[66,33],[66,34],[66,35],[66,36],[66,37],[66,38],[66,39],[66,40],[66,41],[66,42],[66,43],[66,44],[66,45],[66,46],[66,47],[67,48],[67,49],[67,50],[67,51],[67,52],[67,53],[67,54],[67,55],[67,56],[67,57],[67,58],[67,59],[67,60],[67,61],[68,61],[68,60],[68,59],[68,58],[68,57],[68,56],[68,54],[68,53],[68,52],[68,51],[68,50],[68,49],[67,49],[66,48],[66,47],[66,46],[66,47],[66,48],[67,48],[67,49],[67,50],[67,51],[67,52],[67,53],[68,53],[68,54],[68,55],[68,54],[68,53],[68,52],[68,51],[68,50],[68,49],[67,48],[67,47],[67,46],[67,44],[67,43],[67,41],[67,39],[67,37],[67,36],[67,34],[67,33],[67,32],[67,31],[67,29],[67,28],[67,27],[67,26],[67,25],[67,24],[67,23],[68,22],[68,21],[68,20],[68,19],[67,19],[67,18],[67,19],[67,20],[67,21],[67,20],[66,20],[66,19],[66,18],[66,17],[66,16],[66,15],[66,14],[66,13],[66,12],[65,12],[65,11],[65,10],[65,9],[64,9],[64,8],[64,7],[64,6],[63,5],[63,4],[63,3],[62,3],[62,2],[62,1],[61,1],[61,0],[61,0],[61,1],[61,2],[61,3],[62,3],[62,4],[62,5],[63,6],[63,7],[63,8],[64,9],[64,10],[64,11],[64,12],[65,12],[65,13],[65,14],[65,15],[65,16],[66,16],[66,17],[66,18],[66,19],[66,20],[66,21],[67,21],[67,22],[67,23],[67,24],[67,25],[67,26],[67,27],[67,28],[67,29],[67,30],[67,31],[67,32],[67,33],[67,34],[67,35],[67,36],[67,37],[67,38],[66,39],[66,40],[66,41],[67,42],[67,43],[67,44],[67,45],[67,46],[67,47],[67,48],[67,49],[67,50],[67,51],[67,52],[67,51],[67,50],[67,49],[67,48],[66,47],[66,46],[66,45],[66,44],[66,43],[66,42],[66,41],[66,40],[66,39],[67,38],[67,37],[67,36],[67,35],[67,34],[67,33],[66,32],[66,31],[66,30],[66,29],[66,28],[66,27],[66,26],[66,25],[66,24],[66,23],[66,22],[66,21],[66,20],[66,19],[66,18],[66,17],[66,16],[66,15],[66,14],[66,13],[66,12],[66,11],[66,10],[65,10],[65,9],[65,8],[65,7],[64,6],[64,5],[63,4],[63,3],[63,2],[62,1],[62,0],[21,0],[20,0],[20,1],[19,1],[19,2],[19,3],[18,3],[18,4],[18,5],[17,5],[17,6],[17,7],[17,8],[17,9],[16,10],[16,11],[16,12],[15,12],[15,13],[15,14],[14,14],[14,15],[14,16],[14,17],[14,18],[13,18],[13,19],[13,20],[13,21],[12,21],[12,22],[12,23],[12,24],[11,24],[11,25],[10,25],[10,26],[10,27],[10,28],[10,29],[9,29],[9,30],[9,31],[8,31],[6,32],[5,32],[0,32],[0,68],[2,71],[4,74],[5,74],[6,76],[7,75],[7,73],[8,73],[54,79],[54,78],[54,77],[54,76],[55,76],[55,77],[55,78],[55,79],[54,79]]
return arr;
}()
});
setTimeout(function() {
w.start();
});
$('#run').click(function() {
});
window.arr = [];
$('li').mouseover(function(e) {
if(e.button != 2) {
return;
}
$(this).css({
background: 'yellow'
});
var index = $(this).index();
var x = index % w.cols;
var y = index / w.cols;
arr.push([x, parseInt(y)]);
});
$(document).on('contextmenu', function(e){
e.preventDefault();
return false;
});
</script>
</body>
</html>