-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
85 lines (66 loc) · 2.24 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
<html>
<head>
<title>Snake</title>
<link href='style.css' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="glMatrix-0.9.5.min.js"></script>
<script src="RequestAnimationFrame.js"></script>
<script src="texture.js"></script>
<script src="shaders.js"></script>
<script src="buffers.js"></script>
<script src="camera.js"></script>
<script src="maze.js"></script>
<script src="util.js"></script>
<script src="powerUp.js"></script>
<script src="apple.js"></script>
<script src="skybox.js"></script>
<script src="snakebit.js"></script>
<script src="head.js"></script>
<script src="input.js"></script>
<script src="index.js"></script>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
varying vec2 vTextureCoord;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
vTextureCoord = aTextureCoord;
}
</script>
</head>
<body onload="webGLStart()">
<div id ="centreDiv">
<h1>WebGL Snake</h1>
<div id="game-frame">
<canvas id="canvas" width="500" height="500"></canvas>
<div id='score'></div>
</div>
</div>
<div id='explanation'>
<h2>Controls</h2>
<p>W,S - up,down</p>
<p>A,D - left, right</p>
<p>R,F - forward, back</p>
<p>Space - Pause</p>
<h2>Camera</h2>
<p>1 - Free Camera (best when paused)</p>
<p>Mousedrag to look, arrows to move</p>
<p>2 - Orbit</p>
<p>3 - Follow</p>
<p>4 - Fixed</p>
</div>
<div id='console'>
<p id='highScore'>High Score: 0000</p>
</div>
</body>
</html>