-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.html
218 lines (189 loc) · 11.2 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<html>
<head profile="http://www.w3.org/2005/10/profile">
<link rel="shortcut icon" type="image/png" href="/favicon.png">
<title>Humphrey The Rabbit</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="HandheldFriendly" content="true">
<link rel="stylesheet" href="webgl.css" type="text/css">
<!-- for remote debugging --> <!--<script src="http://jsconsole.com/remote.js?[insert thing here]"></script>-->
<script src="random.js"></script>
<script src="utils.js"></script>
<script src="graphics.js"></script>
<script src="entity.js"></script>
<script src="box.js"></script>
<script src="enemy.js"></script>
<script src="player.js"></script>
<script src="powerup.js"></script>
<script src="game.js"></script>
<script src="tutorial.js"></script>
<script src="scene.js"></script>
<script src="devtools.js"></script>
<script src="page.js"></script>
<!-- Fragment shader program -->
<script id="shader-fs" type="x-shader/x-fragment">
varying highp vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform highp vec4 uColour;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t)) * uColour;
}
</script>
<!-- Vertex shader program -->
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform vec2 uPosition;
uniform vec2 uScale;
uniform float uAspectRatio;
//uniform mat4 uMVMatrix;
//uniform mat4 uPMatrix;
varying highp vec2 vTextureCoord;
void main(void) {
gl_Position = vec4(aVertexPosition.x*uScale.x + uPosition.x, aVertexPosition.y * uAspectRatio * uScale.y + uPosition.y, 0, 1);
vTextureCoord = aTextureCoord;
}
</script>
</head>
<body id="body" onload="StartGame();" style="-webkit-touch-callout: none !important; -webkit-user-select: none !important;">
<!-- Noscript page -->
<noscript>
<h2>Humphrey The Rabbit</h2>
<p><img src="data/rabbit/drawing2.svg" width="20%" alt="humphrey the rabbit"/></p>
<p> Humphrey The Rabbit is a game in which Humphrey (controlled by the player) must avoid falling boxes, foxes, and various other hazards. Humphrey The Rabbit requires Javascript. You are seeing this either because you are a search engine bot (in which case please rank me higher) or you are viewing a search engine result, or you are actually at this page but you have disabled Javascript or your browser does not support it. Enable Javascript to play.</p>
<h2> This is what you are missing </h2>
<p> <img src="data/screenshot-2014-07-16.png" width="40%" alt="screenshot of game"/> </p>
</noscript>
<script src="ads.js"></script>
<button type="button" id="startOnMobile" onclick=StartGame()><p>Humphrey The Rabbit: Mobile Edition</p><p>Press to start</p></button>
<div id="gameAndUI" style="display: none; width: 100%; height: 100%">
<!-- Introduction -->
<audio id="theme">
<!--<source src="data/theme.ogg" type="audio/ogg">-->
<!--Your browser does not support the <code>audio</code> tag.-->
</audio>
<div id="statusBar" style="font-size: x-small; position:relative; width:auto; height:auto; border:0px solid red; margin:0 auto;">
<div id="score" style="margin:0 auto; width:100%; text-align:center;">
Lvl <span id="level">0</span> |
<span id="runtime">00:00:00</span>|<img src="data/hats/hat1.gif" height=8px> x <span id="lives">0</span> |
<span title="Runs the tutorial. Oh boy."><a class="statusBarLink" href="javascript:g_game.Start(0)">?</a></span> |
<span title="Modify gameplay and other settings."><a class="statusBarLink" href="javascript:g_game.ToggleSettings()">⚙</a></span>
</div>
<div id="debug" style="margin:0 auto; width:34%; text-align:center;"></div>
</div>
<div id="container" style="width:100%; position:relative; overflow:hidden;">
<div id="leftPanel" style="float:left; text-align: right; border:0px solid black; overflow:hidden; display:block;">
<!-- Put links and things here -->
</div>
<div id="rightPanel" style="float:right; border:2px; text-align: left; solid red; overflow:hidden; display:block;">
<!-- Put ads here -->
<object id="banner" style="width:0px; height:0px;" type="text/html" data="data/adverts/external.html"></object>
</div>
<div id="middlePanel" style="margin:0 auto;">
<!-- The canvas -->
<canvas id="glcanvas" width="0" height="0">
The <code>canvas</code> tag isn't supported, <b>or</b> you have disabled scripts.
</canvas>
<div id="settings" hidden style="float:left; text-align: left;">
<h1>Settings</h1>
<div id=settingsDiv>
<summary>All Settings</summary>
<form autocomplete="off">
<details open=true>
<summary>Browser</summary>
<table>
<tr><td><input type="checkbox" id="playMusic" checked></td><td>Play Music</td></tr>
<tr><td><input type="checkbox" id="autoPause" checked></td><td><span title="Game pauses when tab loses focus.">Auto pause</span></td></tr>
<tr><td><input type="checkbox" id="saveCookies" checked></td><td><span title="Allow us to save cookies. Note that Local Storage (which includes these settings) is still saved.">Save Cookies</span></td></tr>
</table>
</details>
<details open=false>
<summary>Display</summary>
<table>
<tr><td><input type="checkbox" id="displayStatusBar" checked></td><td><span title="This will hide the status bar, including the ⚙. You must use the tilde (`) key to open settings again.">Display Status Bar</span></td></tr>
<tr><td><input type="checkbox" id="simplifiedRendering"></td><td><span title="This will attempt to improve performance by reducing the area on the screen that is redrawn. You may see some visual artifacts.">Faster Rendering</span></td></tr>
</table>
</details>
<details open=false>
<summary>Art Styles</summary>
<details>
<summary>Humphrey Style</summary>
<table>
<tr><td><input type="radio" id="humphrey" name="rabbitSprites" checked></td><td><img src="data/rabbit/humphrey/left1.gif"/> <img src="data/rabbit/humphrey/right2.gif"/></td></tr>
<tr><td><input type="radio" id="neko" name="rabbitSprites"></td><td><img src="data/rabbit/neko/left1.gif"/><img src="data/rabbit/neko/right2.gif"/></td></tr>
</table>
</details>
</details>
<details open=false>
<summary>Advertisements</summary>
<table>
<tr><td><input type="checkbox" id="showAdverts" checked></td><td><span title="Shows an 'advertisement' whenever you die or restart a level">Show Advertisements</span></td></tr>
<tr><td></td><td>Type of adverts shown</td></tr>
<tr><td><input type="radio" name="advertsType" id="memeverts"></td><td><span title="The original advertisements; might be funny, probably not helpful.">Memeverts</span></td></tr>
<tr><td><input type="radio" name="advertsType" id="helpverts" checked></td><td><span title="Show gameplay hints.">Gameplay Hints</span></td></tr>
</table>
</details>
<details open=true>
<summary>Gameplay</summary>
<details open=true>
<summary>Base Difficulty</summary>
<table>
<tr><td><input type="radio" id="baby" name="difficulty"></td><td><span title="Literally nothing can hurt you, but you can only play Level 1.">Baby Mode</span></td></tr>
<tr><td><input type="radio" id="normal" name="difficulty" checked></td><td><span title="The default difficulty. You may gain lives and preserve them between levels.">Normal Mode</span></td></tr>
<tr><td><input type="radio" id="hard" name="difficulty"></td><td><span title="Harder difficulty; lives will never spawn.">Hard Mode</span></td></tr>
<tr><td><input type="radio" id="expert" name="difficulty"></td><td><span title="The classic difficulty; dying takes you to Level 1">Expert Mode</span></td></tr>
<tr><td><input type="radio" id="rage" name="difficulty"></td><td><span title="Hardest difficulty imaginable">Rage Mode</span></td></tr>
</table>
</details>
<details open=false>
<summary>Gameplay Modifiers</summary>
<table>
<tr><td><input type="number", id="maxLevel" value="1" readonly=True></td><td><span title="This is the maximum level you have passed. It will reset if you lower the difficulty!">Max Level</span></td></tr>
<tr><td><input type="number", id="startingLives" value="3" readonly=True></td><td><span title="This is the number of lives you start each level with. Dependent on difficulty">Starting Lives</span></td></tr>
<tr><td><input type="checkbox" id="pacifistMode"></td><td><span title="Does what it says.">Enforce Moral Absolutism</span></td></tr>
<tr><td><input type="checkbox" id="autoPlay"></td><td>Play by myself</td></tr>
</table>
</details>
<details open=false>
<summary>Extra Controls</summary>
<table>
<tr><td><input type="checkbox", id="enableTouchBar"></td><td><span title="Renders some buttons you can use on shitty smartphones">Touch Bar</span></td></tr>
</table>
</details>
<!--details open=false>
<summary>Legacy Modes</summary>
<table>
<tr><td><a href="nostalgia/">"The game is basically finished"</a></td></tr>
</table>
</details-->
</form>
</div>
<details open=false>
<summary>What's this?</summary>
<p>These settings will be saved in your browser's <a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage>Local Storage</a>
They are not communicated to any server.</p>
<p>Some information is still saved in <a href="cookies.html">cookies</a>; you can turn these off below.</p>
<p></p>
<p>Your game is paused; most settings changes will not require you to restart the game, but some will.</p>
</details>
<div id="settingsButtons" style="width:100%;">
<!--<button style="border:none;" type="button" onclick="g_game.ApplySettingsForm();">✔ Apply</button>-->
<button type="button" onclick="g_game.PopulateSettingsForm();">Undo Changes</button>
<button type="button" onclick="g_game.DefaultSettings();">Set to Defaults</button>
<button type="button" onclick="g_game.ToggleSettings();">✔ Apply</button>
<!--<button style="border:none;" type="button" onclick="location.reload();">🔄 Refresh</button> -->
</div>
</div>
</div>
</div>
<!--<div id="spacer" style="position:relative; width:auto; height:50px; margin:0 auto; display: block;"></div>-->
<!-- For touch screen devices that don't support touch events -->
<div id="touchBar" style="height: 48px; width:95%;">
<button id="touchLeft" style="height:95%; width:22.5%; border:none;"><img src="data/rabbit/humphrey/left1.gif">⇦</button>
<button id="touchUp" style="height:95%; width:22.5%; border:none;">⇧<img src="data/rabbit/humphrey/up.gif"></button>
<button id="touchDown" style="height:95%; width:22.5%; border:none;"><img src="data/rabbit/humphrey/down.gif">⇩</button>
<button id="touchRight" style="height:95%; width:22%.5; border:none;">⇨<img src="data/rabbit/humphrey/right1.gif"></button>
</div>
</div>
</body>
</html>