-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
89 lines (84 loc) · 2.55 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Descent VR (wip)</title>
<!-- https://github.com/adrienjoly/a-frame-descent-vr -->
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-super-shooter-kit.min.js"></script>
<script src="ship.js"></script>
<script src="enemy-ship.js"></script>
<script src="controls.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<!-- external 3d models -->
<a-assets>
<a-asset-item
id="tinkercadcockpit"
src="https://cdn.glitch.com/2ce265aa-7406-4a44-8c1c-00f1a141bbc6%2Ftinker.obj"
></a-asset-item>
</a-assets>
<!-- from https://github.com/supermedium/aframe-super-shooter-kit -->
<a-entity
id="bulletTemplate"
bullet
geometry="primitive: sphere; radius: 0.1"
material="color: orange"
></a-entity>
<!-- level: basic room -->
<a-box
id="room-1"
position="0 0 0"
depth="80"
height="20"
width="20"
color="blue"
material="side: double"
></a-box>
<!-- enemy ship -->
<a-entity
class="enemy"
target="healthPoints: 10"
position="0 1.5 -10"
rotation="90 0 10"
radius="0.5"
height="1.5"
geometry="primitive: cone"
material="color: teal"
destroyable
shadow
></a-entity>
<!-- player's ship -->
<a-entity id="rig" position="0 0 0" shooter>
<!-- ship's structure and cockpit -->
<a-entity
obj-model="obj: #tinkercadcockpit"
opacity="0.5"
scale="0.01 0.01 0.01"
rotation="-70 180 0"
position="0 0.8 0"
material="color: #777; metalness: 0.5"
></a-entity>
<!-- oculus controllers (hidden) -->
<a-entity
id="left-hand"
model="true"
oculus-touch-controls="hand: left"
rig-rotation-controller="rig"
></a-entity>
<a-entity
id="right-hand"
model="true"
oculus-touch-controls="hand: right"
rig-movement-controller="rig"
></a-entity>
<!-- player's point of view -->
<a-entity id="camera" camera position="0 1.6 0" fix-height-on-desktop>
</a-entity>
</a-entity>
<!-- player controls -->
<a-entity id="keyboard-control" keyboard-control="rig"></a-entity>
</a-scene>
</body>
</html>