-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
156 lines (142 loc) · 5.78 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Chroma Scape</title>
<!-- Include external libraries -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/opentype.js@latest/dist/opentype.min.js"></script>
-->
<script src="js/lib/__cache__/jquery.min.js"></script>
<script src="js/lib/__cache__/opentype.min.js"></script>
<script src="js/lib/gl-matrix.js"></script>
<script src="js/lib/howler/howler.core.js"></script>
<script src="js/lib/howler/plugins/howler.spatial.js"></script>
<!-- Include core game files -->
<script src="js/app.js"></script>
<script src="js/math.js"></script>
<script src="js/globalvars.js"></script>
<script src="js/fileloader.js"> </script>
<script src="js/steptimer.js"></script>
<script src="js/color.js"></script>
<script src="js/program.js"></script>
<script src="js/scene.js"></script>
<script src="js/model.js"></script>
<script src="js/aabb.js"></script>
<script src="js/assets.js"></script>
<script src="js/gamestate.js"></script>
<script src="js/splashscreen.js"></script>
<script src="js/scoreboard.js"></script>
<!-- Include Rendering System & Related Components -->
<script src="js/rendering/rendertarget.js"></script>
<script src="js/rendering/renderpass.js"></script>
<script src="js/rendering/viewport.js"></script>
<script src="js/rendering/renderpipeline.js"></script>
<script src="js/rendering/material.js"></script>
<script src="js/rendering/stages/renderingstage.js"></script>
<script src="js/rendering/stages/geometrystage.js"></script>
<script src="js/rendering/stages/uitextstage.js"></script>
<!-- Include Post Processing Effects -->
<script src="js/post-fx/ui-pass.js"></script>
<script src="js/post-fx/crt-pass.js"></script>
<script src="js/post-fx/scanline-pass.js"></script>
<script src="js/post-fx/copy-pass.js"></script>
<script src="js/post-fx/scale-pass.js"></script>
<script src="js/post-fx/curved-pass.js"></script>
<script src="js/post-fx/barrel-pass.js"></script>
<!-- Include entity components -->
<script src="js/components/component.js"></script>
<script src="js/components/meshcomponent.js"></script>
<script src="js/components/transformcomponent.js"></script>
<script src="js/components/inputcomponent.js"></script>
<script src="js/components/physicscomponent.js"></script>
<script src="js/components/audiocomponent.js"></script>
<script src="js/components/textcomponent.js"></script>
<!-- Include entities -->
<script src="js/entities/entity.js"></script>
<script src="js/entities/camera.js"></script>
<script src="js/entities/gameworld.js"></script>
<script src="js/entities/dummy.js"></script>
<script src="js/entities/player.js"></script>
<script src="js/entities/ship.js"></script>
<script src="js/entities/portal.js"></script>
<script src="js/entities/spawner.js"></script>
<script src="js/entities/speaker.js"></script>
<script src="js/entities/pillar.js"></script>
<script src="js/entities/menucontroller.js"></script>
<script src="js/entities/hudcontroller.js"></script>
<script src="js/entities/wall.js"></script>
<!-- Include js mesh files -->
<script src="js/meshes/test.js"></script>
<script src="js/meshes/ship.js"></script>
<script src="js/meshes/grid.js"></script>
<script src="js/meshes/aabb.js"></script>
<script src="js/meshes/portal.js"></script>
<script src="js/meshes/pillar.js"></script>
<script src="js/meshes/wall.js"></script>
<script src="js/meshes/floor.js"></script>
<!-- Include stylesheets -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Define our gl canvas. -->
<img src="assets/splashscreen/splash.png" id="hiddenSplash">
<img id="hidden">
<img id="hidden2">
<canvas id="glcanvas"></canvas>
<canvas id="textcanvas"></canvas>
<script>
var debug = null; //This variable exists so that we can print information about our "main class" in console without jQuery getting in our way.
var drawAABB = false;
var postProcessing = true;
var god = false;
var fonts = ['PressStart2P-Regular'];
$(document).ready(() => {
"use strict";
// Setup initial AJAX settings.
$.ajaxSetup({
cache: true,
async: false
});
$(document).click( () => {
$('#glcanvas')[0].requestPointerLock();
});
var startGame = () => {
// Instantiate the application.
var app = new App();
// Setup debug reference to app.
debug = app;
// Setup app and handle response.
switch(app.setup()) {
case AppStatus.STATUS_OK: app.exec(); break;
case AppStatus.STATUS_BAD_BROWSER: alert("Your web browser does not support WebGL!"); break;
default: break;
}
};
var onFontLoaded = (fontname) => {
console.log("[FONT]:" + fontname + " has been loaded!");
var cidx = fonts.indexOf(fontname);
if(cidx >= 0) {
fonts.splice(cidx, 1);
if(fonts.length == 0) {
startGame();
}
}
};
var loadfont = (fontname) => {
opentype.load('assets/fonts/' + fontname + '.ttf', (err, font) => {
if(err) {
alert('Font could not be loaded: ' + err);
} else {
Assets.getInstance().addFont(fontname, font);
onFontLoaded(fontname);
}
});
};
fonts.forEach((value, index, array) => {
loadfont(value);
});
});
</script>
</body>
</html>