-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·83 lines (67 loc) · 2.82 KB
/
Copy pathindex.html
File metadata and controls
executable file
·83 lines (67 loc) · 2.82 KB
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
<html>
<head>
<title>Quantum</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" href="/worldJS/style.css" type="text/css" />
<script src="/worldJS/gl-matrix.js"></script>
<script src="/quantum/quantum.js"></script>
<script type="text/javascript">
function init() {
var fullscreenDiv = document.getElementById('fullscreen-tab');
ContainerManager.initSingleton(fullscreenDiv,
document.getElementById('game-div'));
var hudCanvas = document.getElementById('hud-canvas')
var hud = new HUD(hudCanvas).
addWidget(new Crosshair()).
addWidget(new Fraps(-100, 25)).
addWidget(new StartButton()).
addWidget(new ScoreCard(25, 25)).
addWidget(new UpdatingWriter(25, -100, function() {
return 'Rails: ' + Env.world.hero.railAmmo;
}));
// addWidget(new UpdatingWriter(25, 25, function() {
// var t = Math.floor(Env.world.age);
// return Math.floor(t/60) + (t%60 < 10 ? ':0' : ':') + t%60;
// })).
// addWidget(new UpdatingWriter(25, 50, function() {
// if (!Env.world) return;
// var left = Env.world.killsLeft;
// this.font = 'bold 18px courier';
// if (left == 0) {
// this.font = 'bold 28px wolfenstein';
// this.fillStyle = '#F00';
// return 'Der Job ist Kompl' + String.fromCharCode(235) + 'ten';
// }
// return left + ' crate' + (left == 1 ? '' : 's') + ' left!';
// }));
var glCanvas = document.getElementById('gl-canvas');
ShaderProgram.defaultDomain = '';
var gl = GL.createGLWithDefaultShaders(glCanvas);
var resizer = new FullWindowResizer(gl, glCanvas, hud, hudCanvas);
resizer.attachEventListener();
Thing.defaultVelocityType = Thing.VelocityType.RELATIVE;
var world = new QuantumWorld();
Env.setEnvironment(world, hud, gl);
Textures.initTextures(TextureList).then(function(value) {
Animator.initSingleton(world, hud);
world.populate();
resizer.resize();
world.inputAdapter.attachEvents();
Animator.getInstance().setPaused(true);
Animator.getInstance().start();
});
}
</script>
</head>
<body onload="init();">
<div id="fullscreen-tab">
<div id="game-div" tabindex="1">
<canvas id="gl-canvas"></canvas>
<canvas id="hud-canvas"></canvas>
</div>
<canvas id="hidden-canvas"></canvas>
<div>
</body>
</html>