-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhexagon.html
108 lines (102 loc) · 3.25 KB
/
hexagon.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>
<head>
<title>Hex</title>
<script src='http://code.jquery.com/jquery-1.10.2.min.js' language='Javascript' type='text/javascript'></script>
<script type="text/javascript" src="js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<link href="css/bootstrap-select.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
.Game {
position: relative;
border: 1px solid orange;
width: 1200px;
height: 900px;
}
.Game > canvas {
position: absolute;
width: 100%;
height: 100%;
}
.Game > #controls {
position: absolute;
bottom: 750px;
left: 1000px;
height: 40px;
}
.Game > #endTurn {
position: absolute;
bottom: 785px;
left: 1000px;
height: 40px;
}
.Game > #fortify {
position: absolute;
bottom: 750px;
left: 1000px;
height: 40px;
}
.Game > #unitPlacement {
position: absolute;
bottom: 785px;
left: 1000px;
height: 40px;
}
.Game > #unitButtons {
position: absolute;
bottom: 785px;
left: 1000px;
height: 40px;
}
</style>
</head>
<body>
<input type="hidden" name="username" id="username" value="<?php echo $_SESSION['user']['username']; ?>">
<div class=Game>
<canvas id="HexCanvas" width="1200" height="900"></canvas>
<div class="controls" id="endTurn">
<button type="button" id="endTurnButton" class="btn btn-primary">End Turn</button>
<button type="button" id="fortifyButton" class="btn btn-primary">Fortify</button>
</div>
<div class="controls" id="unitPlacement" style="display:none">
<p>Select number of units, then click a hexagon.</p>
<div class="btn-group" data-resize="auto">
<select id="place"></select> Units.
</div>
</div>
<div class="controls" id="fortify" style="display:none">
<div class="btn-group" data-resize="auto">
Transfer:
<select id="transfer"></select> Units.
</div>
<br>
<button type="button" class="btn btn-success" id="transferButton">Move</button>
<button type="button" class="btn btn-danger" id="transferMaxButton">Move(max)</button>
</div>
<div class="controls" id="controls" style="display:none">
<button type="button" id="singleAttack" class="btn btn-primary">Single Attack</button>
<button type="button" id ="continuousAttack" class="btn btn-primary">Continuous Attack</button>
</div>
<div class="controls" id="unitButtons" style="display:none">
<button type="button" id="undoLast" class="btn btn-danger">Undo Last</button>
<button type="button" id ="undoAll" class="btn btn-danger">Undo All</button>
<button type="button" id ="compPlc" class="btn btn-success">Complete Placement</button>
</div>
<p style="position: absolute; bottom: 850px; left: 1000px;" id="msg">Welcome!</p>
<p style="position: absolute; bottom: 820px; left: 1000px;" id="units"></p>
</div>
<script src="js/hexagon-rewrite.js"></script>
<script src="js/HexagonGrid.js"></script>
<script src="js/drawHexGrid.js"></script>
<script src="js/drawHex.js"></script>
<script src="js/getSelectedTile.js"></script>
<script src="js/clickEvent.js"></script>
<script src="js/util.js"></script>
</body>
<script>
$('#transfer').on('changed', function (evt, data) {
console.log(data);
});
</script>
</html>