-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
65 lines (56 loc) · 2.57 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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gameboy VR Experience</title>
<script src="amebo.js"></script>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="canvas-updater.js"></script>
<script src="gbc-canvas.js"></script>
<script src="controls.js"></script>
<script src="control-target.js"></script>
<script src="game.js"></script>
<script src="games.js"></script>
</head>
<body>
<div id="noroms" style="display:none; position:relative; z-index:1; background:white; width:100%; height:100%; padding:10px; font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;">
<h2>Error: No ROMS provided</h2>
<p><i>This emulator requires ROMS (Gameboy games) to be provided as a URL parameter named "roms".</i></p>
<p>1. Create a JSON file with the format:
<code><pre>
[
{
"img": "https://example.com/game1-cover.jpg",
"rom": "https://example.com/game1-rom.gbc"
},
{
"img": "https://example.com/game2-cover.jpg",
"rom": "https://example.com/game2-rom.gbc"
}
]
</pre></code>
</p>
<p>2. Upload the JSON file somewhere (like <a href="https://glitch.com/create" target="_blank">glitch.me</a>)</p>
<p>3. Provide the file link as a URL parameter named "roms":
<code><pre>
https://gameboy.webvr.link?roms=https://example.glitch.me/roms.json
</pre>
</code>
</p>
</div>
<a-scene environment="preset: forest; shadow: true; groundTexture: walkernoise; lightPosition: 1 1 1;">
<a-assets>
<canvas id="screen" width="512" height="512"></canvas>
<a-asset-item id="gameboy" src="assets/gameboy-blue.gltf"></a-asset-item>
<a-asset-item id="game" src="assets/game-light.gltf"></a-asset-item>
</a-assets>
<a-entity id="gbparent" control-target position="0 1.3 -0.5" scale="0.4 0.4 0.4" rotation="-15 0 0">
<a-plane position="0 1.22 0" rotation="0 0 0" width="1.14" height="1.08" material="shader:flat; src:#screen;" gbc-canvas="" canvas-updater></a-plane>
<a-entity id="gb" position="0 0 -0.415" gltf-model="#gameboy" shadow="cast: true; receive: false;"></a-entity>
</a-entity>
<a-entity games=""></a-entity>
<a-entity controls></a-entity>
<a-entity light="type: spot; target: #gb; distance: 5;" position="0 1.3 0"></a-entity>
</a-scene>
</body>
</html>