/
game.html
130 lines (128 loc) · 4.01 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
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
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta property="og:title" content="HappyFunTimes BoomBoom" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://greggman.github.io/HappyFunTimes/" />
<meta property="og:description" content="HappyFunTimes is a library for making party games that are meant to be played with a bunch of people in the same room and 1 ideally large display" />
<title>BoomBoom</title>
<link href="icon.png" rel="shortcut icon" type="image/png">
<link rel="stylesheet" href="node_modules/hft-sample-ui/css/game.css">
<link rel="stylesheet" href="css/game.css">
</head>
<body>
<div id="visual" class="hft-fullsize">
<canvas id="playfield" class="hft-fullsize"></canvas>
</div>
<div id="timeContainer">
<div id="time"></div>
</div>
<div id="overlay" class="hft-fullsize">
<div id="overlay-inner">
<div id="overlay-line1"></div>
<div id="overlay-line2"></div>
</div>
</div>
<div id="grid">
</div>
<script id="persistVertexShader" type="whatever">
attribute vec2 position;
attribute vec2 texCoord;
varying vec2 v_texCoord;
void main() {
gl_Position = vec4(position, 0, 1);
v_texCoord = texCoord;
}
</script>
<script id="persistFragmentShader" type="whatever">
precision mediump float;
uniform sampler2D newRender;
uniform sampler2D oldRender;
uniform float persistence;
varying vec2 v_texCoord;
void main() {
vec4 newColor = texture2D(newRender, v_texCoord);
vec4 oldColor = texture2D(oldRender, v_texCoord);
float alpha = newColor.a;
float mixAmount = length(newColor.xyz) * alpha;
mixAmount = mix(persistence, 1.0, alpha);
gl_FragColor =
vec4(
mix(oldColor.g, newColor.r, mixAmount),
mix(oldColor.b, newColor.g, mixAmount),
mix(oldColor.r, newColor.b, mixAmount),
1);
}
</script>
<script id="mainVertexShader" type="whatever">
attribute vec2 position;
attribute vec2 texCoord;
varying vec2 v_texCoord;
void main() {
gl_Position = vec4(position, 0, 1);
v_texCoord = texCoord;
}
</script>
<script id="mainFragmentShader" type="whatever">
precision mediump float;
uniform sampler2D texture;
varying vec2 v_texCoord;
void main() {
vec4 color = texture2D(texture, v_texCoord);
gl_FragColor = color;
}
</script>
<div id="hft-connect">
<div id="hft-ins"></div>
</div>
<div id="hft-debug">
<pre id="hft-status"></pre>
<div id="hft-console"></div>
</div>
<div id="hft-disconnected">
<div class="hft-fullcenter">
<div class="hft-instruction">Disconnected</div>
<div id="hft-reload">...lost connection to happyFunTimes (T_T)...</div>
</div>
</div>
<div id="settings">
<div class="hft-fullcenter">
<div class="border">
<div class="title">Settings</div>
<div class="settings">
</div>
<div class="buttons">
<button class="cancel">Cancel</button>
<button class="ok">Ok</button>
</div>
</div>
</div>
</div>
<div id="instruction">
<div class="hft-fullcenter">
<div class="border">
<div class="title"><img src="icon.png">BoomBoom!<img src="icon.png"></div>
<div class="subtitle">Booming with 2 to 100+ players</div>
<div class="ins">
Plug in USB controllers and press a button and/or
get your smartphone <span class="strong">on the same network as your computer</span>
then go to <a class="highlight" href="http://happyfuntimes.net">happyfuntimes.net</a>
on your phone's browser.
</div>
<div class="ins">
This is mostly an example game using <a href="http://docs.happyfuntimes.net">happyfuntimes</a>.
A system that lets you support lots of players using their phones as controllers.
<a href="http://docs.happyfuntimes.net">Click here for more info</a>.
</div>
<div class="ins">
Click or press a key for settings
</div>
</div>
</div>
</div>
<script>
require('./scripts/game-electron');
</script>
</body>
</html>