This repository has been archived by the owner on Sep 11, 2019. It is now read-only.
/
game.html
77 lines (75 loc) · 2.37 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
<!DOCTYPE html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>Super Angry Pixel Gamepad</title>
<style>
@font-face{
font-family: "bit";
src: url("game/css/8bit.ttf");
}
* {
padding: 0;
margin: 0;
-webkit-touch-callout: none;
-webkit-user-select: none; /* Disable selection/copy in UIWebView */
}
html
{
-ms-touch-action: manipulation;
touch-action: manipulation;
}
body
{
width: 100%;
height: 100%;
margin: 0px;
padding:0px;
touch-action: none;
-ms-touch-action: none;
overflow:hidden;
font-family: "bit";
}
canvas
{
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: -o-crisp-edges;
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor;
touch-action-delay: none;
touch-action: none;
-ms-touch-action: none;
}
</style>
</head>
<body>
<canvas id="game"></canvas>
<script src="https://cdn.rawgit.com/32teeth/html5-plugin-canvas-gamepad/master/example/game/js/game.js"></script>
<script src="https://cdn.rawgit.com/32teeth/html5-plugin-canvas-gamepad/master/example/game/js/ads.js"></script>
<script src="https://cdn.rawgit.com/32teeth/multikey.js/master/js/multikey.js"></script>
<script src="https://cdn.rawgit.com/32teeth/html5-plugin-canvas-gamepad/master/CanvasGamepad.js"></script>
<script>
CanvasGamepad.setup(
{
canvas:"controller",
start:{name:"start", key:"b"},
select:{name:"select", key:"v"},
trace:true,
debug:true,
hint:true,
buttons:[
{name:"a", "key":"s"},
{name:"b", "key":"a"},
{name:"x", "key":"w"},
{name:"y", "key":"q"}
]
}
);
multikey.setup(CanvasGamepad.events, "qwasbv", true);
</script>
</body>
</html>