forked from aframevr/a-blast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
207 lines (190 loc) · 10.5 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A-Blast</title>
<meta name="description" content="A WebVR wave shooter game using A-Frame by Mozilla VR.">
<meta name="theme-color" content="#3d4d55">
<!--<script src="vendor/aframe-master.min.js"></script>-->
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<script src="build/build.js"></script>
<script src="vendor/aframe-bmfont-component.min.js"></script>
<script src="assets/data/waves.js"></script>
<link rel="stylesheet" href="css/main.css">
<link rel="icon" href="assets/images/icon-128.png">
<link rel="manifest" href="manifest.webmanifest">
</head>
<body>
<a-scene countdown="start: 05:00; value: 00:00" gamestate="health: 5; wave: 0" gamestate-visuals="" decals="maxDecals: 30; src: #bulletDecal; size: 0.3" vr-analytics>
<a-assets>
<a-asset-image src="assets/images/enemy_emissive0.jpg" crossOrigin="anonymous"> </a-asset-image>
<a-asset-image src="assets/images/enemy_emissive1.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/enemy_emissive2.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/enemy_emissive3.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/enemy_diff.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/enemy_spec.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/gun_diff.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/gun_spec.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/gun_normal.png" crossOrigin="anonymous"></a-asset-image>
<a-asset-image src="assets/images/decal0.png" crossOrigin="anonymous"></a-asset-image>
<a-asset-image id="emissive0" src="assets/images/enemy_emissive0.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image id="emissive1" src="assets/images/enemy_emissive1.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-image id="emissive2" src="assets/images/enemy_emissive2.jpg" crossOrigin="anonymous"></a-asset-image>
<a-asset-item id="enemy0" src="assets/models/enemy0.json"></a-asset-item>
<a-asset-item id="enemy1" src="assets/models/enemy1.json"></a-asset-item>
<a-asset-item id="enemy2" src="assets/models/enemy2.json"></a-asset-item>
<a-asset-item id="enemy3" src="assets/models/enemy3.json"></a-asset-item>
<a-asset-item id="playerBullet" src="assets/models/player-bullet.json"></a-asset-item>
<a-asset-item id="enemyBullet" src="assets/models/enemy-bullet.json"></a-asset-item>
<img id="bulletDecal" src="assets/images/decal0.png" crossOrigin="anonymous">
<img id="hurtImg" src="assets/images/damage.png" crossOrigin="anonymous">
<img id="fx1" src="assets/images/fx1.png" crossOrigin="anonymous">
<img id="fx2" src="assets/images/fx2.png" crossOrigin="anonymous">
<img id="fx3" src="assets/images/fx3.png" crossOrigin="anonymous">
<img id="fx4" src="assets/images/fx4.png" crossOrigin="anonymous">
<img id="fx5" src="assets/images/fx5.png" crossOrigin="anonymous">
<img id="fx6" src="assets/images/fx6.png" crossOrigin="anonymous">
<img id="fx7" src="assets/images/fx7.png" crossOrigin="anonymous">
<img id="fx8" src="assets/images/fx8.png" crossOrigin="anonymous">
<audio id="mainThemeOgg" src="assets/sounds/music.ogg" crossorigin="anonymous"></audio>
<audio id="introOgg" src="assets/sounds/intro.ogg" crossorigin="anonymous"></audio>
<audio id="explosion0" src="assets/sounds/explosion0.ogg" crossorigin="anonymous"></audio>
<audio id="explosion1" src="assets/sounds/explosion1.ogg" crossorigin="anonymous"></audio>
<audio id="explosion2" src="assets/sounds/explosion2.ogg" crossorigin="anonymous"></audio>
<audio id="explosion3" src="assets/sounds/explosion3.ogg" crossorigin="anonymous"></audio>
<audio id="hitbullet" src="assets/sounds/hitbullet.ogg" crossorigin="anonymous"></audio>
<audio id="hitwall" src="assets/sounds/hitwall.ogg" crossorigin="anonymous"></audio>
<audio id="hurtOgg" src="assets/sounds/hurt.ogg" crossorigin="anonymous"></audio>
<audio id="enemy0shoot" src="assets/sounds/enemy0shoot.ogg" crossorigin="anonymous"></audio>
<audio id="enemy1shoot" src="assets/sounds/enemy1shoot.ogg" crossorigin="anonymous"></audio>
<audio id="enemy2shoot" src="assets/sounds/enemy2shoot.ogg" crossorigin="anonymous"></audio>
<audio id="enemy3shoot" src="assets/sounds/enemy3shoot.ogg" crossorigin="anonymous"></audio>
</a-assets>
<a-entity id="introMusic" sound="src: #introOgg; loop: true; positional: false" sound-fade="from: 0; to: 0.3; duration: 8000; "></a-entity>
<a-entity id="mainThemeMusic" sound="src: #mainThemeOgg; loop: true; volume:0.2; positional: false"></a-entity>
<a-entity id="hurtSound" position="0 1.7 -0.2" sound="src: #hurtOgg; loop: false; volume:1; poolSize: 2"></a-entity>
<a-entity id="explosion0" sound="src:#explosion0"></a-entity>
<a-entity id="explosion1" sound="src:#explosion1"></a-entity>
<a-entity id="explosion2" sound="src:#explosion2"></a-entity>
<a-entity light="color: #ffffff; groundColor: #79a8bb; intensity: 0.3; type: hemisphere"></a-entity>
<a-entity position="0 50 0" light="intensity: 0.9; type: point"></a-entity>
<a-entity position="0 -50 0" light="intensity: 0.5; type: point"></a-entity>
<a-entity id="sky"
rotation="0 90 0"
geometry="primitive: sphere; radius: 600; segmentsHeight: 32; segmentsWidth: 32"
material="shader: flat; fog: false; side: back; src: url(assets/images/sky.jpg)"
></a-entity>
<a-entity id="player"
camera="userHeight: 1.6"
wasd-controls
look-controls
restrict-position
shoot="direction: 0 0 -1; spaceKeyEnabled: true">
<a-entity id="hurt"
proxy_event="event: player-hit; dst:#hurt"
geometry="primitive:sphere;radius:0.5;segmentsHeight:6;segmentsWidth:7"
position="0 0 -0.2"
rotation="0 90 0"
material="shader: flat; side: back; transparent: true; opacity: 0; depthTest: false; src: #hurtImg">
<a-animation id="player-hit-anim" attribute="material.opacity" to="1" from="0" begin="player-hit" direction="alternate" dur="200" repeat="1"></a-animation>
</a-entity>
</a-entity>
<!-- Hands. -->
<a-entity id="leftHand" shoot-controls="hand: left" weapon shoot></a-entity>
<a-entity id="rightHandPivot">
<a-entity id="rightHand" shoot-controls="hand: right" weapon shoot></a-entity>
</a-entity>
<a-entity id="ring0" json-model="src:url(assets/models/ring.json); singleModel:true)" position="0 0 0" rotation="0 0 0" scale="1.3 1.3 1.3">
<a-animation id="ring0anim" attribute="rotation" to="0 360 180" repeat="indefinite" dur="50000" easing="linear"></a-animation>
</a-entity>
<a-entity id="ring1" json-model="src:url(assets/models/ring.json); singleModel:true)" position="0 0 0" rotation="90 0 0">
<a-animation id="ring1anim" attribute="rotation" to="90 360 180" repeat="indefinite" dur="30000" easing="linear"></a-animation>
</a-entity>
<a-entity id="border" json-model="src:url(assets/models/border.json);" position="0 0 0"></a-entity>
<a-entity id="highscores" position="2.2 2.2 -3.15" rotation="0 -45 0">
<a-entity
bmfont-text="fntImage:assets/fonts/mozillavr.png;
fnt:assets/fonts/mozillavr.fnt;
scale:0.002;
text:HALL OF FAME;
color:#f00">
</a-entity>
<a-entity
highscores
visible = "true"
position="0 -0.15 0">
</a-entity>
</a-entity>
<!--
<a-entity id="gamestateDebug"
gamestate-debug
position="-5 1 -3"
rotation="0 65 0"></a-entity>
</a-entity>
-->
<a-entity id="finished" visible="false">
<a-entity id="message-group">
<a-entity id="gameover-model" json-model="src:url(assets/models/gameover.json)"></a-entity>
<a-entity id="welldone-model" json-model="src:url(assets/models/welldone.json)"></a-entity>
</a-entity>
<a-entity id="reset"
collision-helper="radius: 0.7"
json-model="src: url(assets/models/restart.json);"
material="color: #f00; flatShading: true"
position="0 0.5 -6">
</a-entity>
</a-entity>
<a-entity id="mainmenu">
<a-entity id="logo" json-model="src:url(assets/models/logo.json)" animate-message=""></a-entity>
<a-entity id="start_enemy"
enemy="name: enemy_start; canShoot: false"
collision-helper="radius: 0.65"
json-model="
src: url(assets/models/enemy0.json);
texturePath: url(assets/images/);
singleModel: true"
position="0 1.2 -7"
scale="1.3 1.3 1.3">
</a-entity>
</a-entity>
<a-entity
position="-2.04 -0.32 -3.81"
rotation="-14.54 25 0">
<a-entity
timer-counter="value: 00:00">
</a-entity>
<a-entity id="lifes-counter"
position="0.07 -0.25 -0.01"
gamestate-bind="health: lifes-counter.value"
lifes-counter="value: 5">
</a-entity>
</a-entity>
<a-entity id="points-counter"
position="1.5 -0.38 -4"
rotation="-14.54 -25 0"
points-counter="value: 000"
gamestate-bind="points: points-counter.value">
</a-entity>
</a-scene>
<div id="ablast-ui" class="hide">
<div class="hiscore hided">
<div class="help">
<h1 id="highscore_message">Good job!</h1>
<p>Please enter your name to join the Hall of Fame!</p>
</div>
<div class="form">
<input id="player-name" type="text" value=""/>
<div id="save-score" class="button save">SAVE!</div>
</div>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-80530812-3', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>