-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
executable file
·96 lines (82 loc) · 2.56 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
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
<html>
<head>
<link href='style/main.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="wrapper" width="800" height"600">
HEARTLINE<br/>
<canvas id="gamecanvas" width="800" height="512"></canvas><br/>
<a id="click" href="#">Full Screen</a> <a id="controlsLink" href="#">Controls</a>
</div>
<div id="controls">
<pre>
Press ESC to reconfigure your bindings.
Plug in your USB Gamepad if you have one!
Default Controls:
Player 1:
W,A,S,D - Movement
V - Shoot
B - Jump
N - Throw
Player 2:
Arrow Keys - Movement
Numpad1 - Shoot
Numpad2 - Jump
Numpad3 - Throw
</pre>
</div>
<script src='js/jquery.min.js'></script>
<script src='js/room.js'></script>
<script src='js/entitymanager.js'></script>
<script src='js/entity.js'></script>
<script src='js/player.js'></script>
<script src='js/goo.js'></script>
<script src='js/door.js'></script>
<script src='js/heart.js'></script>
<script src='js/fire.js'></script>
<script src='js/smoke.js'></script>
<script src='js/grate.js'></script>
<script src='js/fan.js'></script>
<script src='js/breakable.js'></script>
<script src='js/goal.js'></script>
<script src='js/controller.js'></script>
<script src='js/assetmanager.js'></script>
<script src='js/game.js'></script>
<script src='js/images.js'></script>
<script src='js/sounds.js'></script>
<script src='js/levels.js'></script>
<script>
$('#controls').hide();
$('#controlsLink').click(function() {
$('#controls').toggle();
});
var div = document.getElementById("wrapper");
var link = document.getElementById("click");
function fs()
{
if (document.webkitIsFullScreen)
document.webkitExitFullscreen()
else
div.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
link.onclick = fs;
var canvas = document.getElementById("gamecanvas");
var defaultHeight = canvas.height;
var defaultWidth = canvas.width;
var ctx = canvas.getContext("2d");
window.onresize = function() {
var newHeight = window.innerHeight - 150;
var newWidth = window.innerWidth - 10;
if (1.0 * defaultWidth / defaultHeight > 1.0 * newWidth / newHeight)
newHeight = 1.0 * newWidth / defaultWidth * defaultHeight
else
newWidth = 1.0 * newHeight / defaultHeight * defaultWidth;
canvas.height = newHeight;
canvas.width = newWidth;
ctx.scale(1.0 * newWidth/defaultWidth, 1.0 * newHeight/defaultHeight)
}
window.onresize();
//div.mozRequestFullScreen();
</script>
</body>
</html>