-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
71 lines (60 loc) · 1.52 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CubeCritters2</title>
<style>
*{
margin:0;
}
canvas{
/* border: 1px dashed black; */
/* image-rendering:pixelated; */
transform: translateY(0);
}
html{
overflow: hidden;
}
</style>
</head>
<body>
<!-- SHADER SOURCE -->
<script type="shader" id="vsSource">
attribute vec2 a_Position;
attribute vec3 a_Color;
varying vec3 v_Color;
uniform vec2 u_ResModi;
uniform vec2 u_Offset;
void main(){
v_Color = a_Color;
gl_Position = vec4((a_Position.x+u_Offset[0])*u_ResModi[0]-1.0,(-a_Position.y+u_Offset[1])*u_ResModi[1]+1.0,0,1);
gl_PointSize = 10.0;
}
</script>
<script type="shader" id="fsSource">
precision mediump float;
varying vec3 v_Color;
void main(){
gl_FragColor = vec4(v_Color,1);
//gl_FragColor = vec4(238.0/255.0, 253.0/255.0, 237.0/255.0,1);
//gl_FragColor = vec4(112.0/255.0,176.0/255.0,192.0/255.0,1);
//gl_FragColor = vec4(0.85,0.5,0.1,1);
}
</script>
<!-- EXTRA -->
<script src="math.js"></script>
<script src="inputHandler.js"></script>
<script src="functions.js"></script>
<!-- render -->
<script src="webgl.js"></script>
<!-- classes -->
<script src="NeuralNetwork.js"></script>
<script src="Quad.js"></script>
<script src="Critter.js"></script>
<script src="Camera.js"></script>
<script src="Player.js"></script>
<script src="Food.js"></script>
<!-- main -->
<script src="main.js"></script>
</body>
</html>