-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.html
85 lines (74 loc) · 2.09 KB
/
game.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
<style>
#game {
border: 1px solid black;
outline: none;
}
assets {
display: none;
}
#main-container {
width:720px;
}
textcontent p {
width:720px;
}
.center {
text-align: center;
}
.padded-bottom {
margin-bottom: 3cm;
}
</style>
<assets>
<img id="img-right-arrow" src="assets/right_arrow.png" />
</assets>
<div id='main-container'>
<canvas id='game' width='720' height='680' tabindex='1'></canvas>
<h3>Welcome to Hex2048!</h3>
<p>Combine hexagons of the same number to get bigger numbers. Try to reach the 2048 tile and more!</p>
<h3>Controls:</h3>
<ul>
<li>Mouse drag and drop</li>
<li>Keyboard keys: QWEASD</li>
</ul>
<div class="padded-bottom"></div>
<footer>
<p class='center'><small>Created by Qingyang Chen and Huajun Gu</small></p>
</footer>
</div>
<script src="js/Assert.js"></script>
<script src="js/CanvasInput.js"></script>
<script src="js/Coordinate.js"></script>
<script src="js/Size.js"></script>
<script src="js/Envelope.js"></script>
<script src="js/Easing.js"></script>
<script src="js/Transition.js"></script>
<script src="js/Hexagon.js"></script>
<script src="js/HexagonAnimated.js"></script>
<script src="js/HexagonBackground.js"></script>
<script src="js/PriorityQueue.js"></script>
<script src="js/Events.js"></script>
<script src="js/Canvas.js"></script>
<script src="js/Button.js"></script>
<script src="js/DrawTimer.js"></script>
<script src="js/Controller.js"></script>
<script src="js/InputDirection.js"></script>
<script src="js/InputHandler.js"></script>
<script src="js/KeyHandler.js"></script>
<script src="js/GestureHandler.js"></script>
<script src="js/Board.js"></script>
<script src="js/Home.js"></script>
<script src="js/HighScore.js"></script>
<script src="js/Lost.js"></script>
<script>
const ASSETS = {
RIGHT_ARROW: document.getElementById('img-right-arrow')
};
const FPS = 60;
const canvas = new Canvas('game');
new InputHandler(canvas);
new KeyHandler();
new GestureHandler(canvas);
const controller = new Controller();
(new DrawTimer(canvas, FPS)).start();
</script>