-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (41 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Block.js</title>
<style>
html, body, canvas { margin: 0; padding: 0; width: 100%; height: 100%;}
</style>
</head>
<body>
<script src="./libs/babylon.custom.js"></script>
<script src="./components/Globals.js"></script>
<script src="./components/Player.js"></script>
<script src="./components/Brick.js"></script>
<script src="./components/Utils.js"></script>
<script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<canvas id="render-canvas"></canvas>
<script>
/**
* Handy links:
* http://doc.babylonjs.com/api/classes/babylon.mesh
* https://doc.babylonjs.com/how_to/solid_particle_system
* http://usejsdoc.org/
*/
var canvas = document.getElementById("render-canvas");
var engine = new BABYLON.Engine(canvas);
var scene = Utils.generateScene(engine, false, false);
var World = Utils.generateWorld();
var UI = Utils.generateUI();
engine.runRenderLoop(function() {
scene.render();
player1.movement();
pulse += 0.1;
player1.tempBrick._mesh.material.alpha = Math.sin(pulse) / 4 + 0.50;
});
// Utils.loadFromServer();
var player1 = new Player("Player1", { spawnPoint: new BABYLON.Vector3(0, 15, -20) }, scene);
</script>
</body>
</html>