forked from VRFPS/VR-FPS-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (45 loc) · 2.93 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
<html>
<head>
<script src="bundle/bundle.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-extras/v3.2.2/dist/aframe-extras.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v1.2.0/dist/aframe-physics-system.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
</head>
<body style="background-color: #030404">
<i class="fa fa-crosshairs" style="color: white; position: absolute; top: 49%; left: 49.5%; z-index: 9999" aria-hidden="true"></i>
<div id="score" style="color: white; position: absolute; top: 3%; left: 1%; z-index: 9999; font-family: 'Press Start 2P', cursive;">CABBAGES DESTROYED : 0</div>
<a-scene id="scene" physics>
<!-- ============================ ASSETS ============================================================ -->
<a-assets>
<img id="skymap" src="assets/images/sky.jpg" crossOrigin="anonymous">
<img id="floor" src="assets/images/floor.jpg" crossOrigin="anonymous">
<a-mixin id="green" material="color: green"></a-mixin>
<a-mixin id="candle" geometry="primitive: box; width: 4; height: 4; depth: 4;" light></a-mixin>
<a-mixin id="position" random-spherical-position="radius: 40; startX: 0; lengthX: 360; startY: 0; lengthY: 360" random-rotation random-position="min: -43 15 -43; max: 43 60 43"></a-mixin>
<a-mixin id="outside-position" random-spherical-position="radius: 40; startX: 0; lengthX: 360; startY: 0; lengthY: 360" random-position="min: -50 110 -50; max: 120 120 120"></a-mixin>
<a-mixin id="laser"
geometry="primitive: sphere; radius: 0.25"
material="color: red; metalness: 0.2; opacity: 0.8; roughness: 0.3; side: double"
rotation="90 0 0"
projectile="speed: -0.25" collider-check="target: .enemy">
</a-mixin>
</a-assets>
<!-- ============================ ENTITIES ============================================================ -->
<a-box id="ground"
geometry="primitive: box; width: 200; height: 0.1; depth: 200"
material="shader: flat; src: #floor" static-body>
</a-box>
<a-entity id="sky"
geometry="primitive:sphere; radius:100; phiLength:360; phiStart:0; thetaLength:90"
material="shader:flat; side:back; height:2048; src:#skymap; width:2048">
</a-entity>
<a-entity entity-generator="mixin: green candle position; num: 10;"></a-entity>
<a-camera id="player"
universal-controls position="1 1.8 0"
spawner="mixin: laser"
jump-ability="maxJumps: 2; distance: 10;" kinematic-body
click-listener fence="width: 125; depth: 125;"></a-camera>
</a-scene>
</body>
</html>