forked from Mashpoe/1D-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (142 loc) · 3.88 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
<html>
<head>
<style>
html,
body {
margin: 0px;
text-align: center;
background-color: black;
color: white;
font-family: Arial, Helvetica, sans-serif;
}
#buttonContainer {
font-size: 0px;
text-align: left;
}
.button {
box-sizing: border-box;
display: inline-block;
width: 33.33%;
border-radius: 25px;
border: 10px solid #000;
text-align: center;
font-size: 20px;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
background-color: #222;
}
.button-icon {
display: block;
width: 100%;
font-size: 50px;
height: 70px;
overflow: hidden;
}
.button-label {
display: block;
width: 100%;
font-size: 16px;
height: 30px;
padding-top: 5px;
box-sizing: border-box;
overflow: hidden;
}
#buttonF {
float: right;
}
#buttonS .button-icon {
transform: rotate(45deg);
}
</style>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<body>
<br />
<canvas id="canvas2d"></canvas>
<br />
<br />
Level: <span id="level">Tutorial</span>
<br />
<br />
<canvas id="canvas1d" style="margin-top: 150px"></canvas>
<div id="buttonContainer" style="display: none">
<div class="button" id="buttonS">
<div class="button-label">shoot</div>
<div class="button-icon">⦻</div>
</div>
<div class="button" id="buttonF">
<div class="button-label">move forward</div>
<div class="button-icon">▲</div>
</div>
<br />
<div class="button" id="buttonL">
<div class="button-icon">↶</div>
<div class="button-label">turn left</div>
</div>
<div class="button" id="buttonR">
<div class="button-icon">↷</div>
<div class="button-label">turn right</div>
</div>
<div class="button" id="buttonB">
<div class="button-icon">▼</div>
<div class="button-label">move back</div>
</div>
</div>
<br />
<br />
<div>
<input type="checkbox" id="anaglyph" />
<label for="anaglyph">3D Anaglyph</label>
<br />
<input type="checkbox" id="show2d" checked />
<label for="show2d">Show 2D Display</label>
<br />
<input type="checkbox" id="bigPicture" checked />
<label for="bigPicture">Big Picture Mode</label>
<br />
<lable for="quality">1D Render Quality:</lable>
<input type="range" min="1" max="10" value="8" class="slider" id="quality" />
<br />
<br />
<span>Textures labeled "3D" are best for 3D anaglyph.</span>
<br />
<br />
<label for="texture">World Texture:</label>
<select id="texture">
<option value="0">Gray Waves (3D)</option>
<option value="1">Blue-Green Waves</option>
<option value="2">Trippy</option>
<option value="3">Gray Stripes (3D)</option>
<option value="4">Yellow Stripes (3D)</option>
<option value="5">Solid Red</option>
<option value="6">Barcode (3D)</option>
<option value="7" selected>Black & White</option>
</select>
<br />
<br />
<div id="controls">Controls: WASD or arrow keys to move. Space, Z, or X to shoot.</div>
</div>
<br />
<br />
<br />
<br />
<script src="https://cdn.socket.io/4.0.0/socket.io.min.js"></script>
<script src="scripts/utils/config.js"></script>
<script src="scripts/utils/textures.js"></script>
<script src="scripts/utils/serial.js"></script>
<script src="scripts/utils/inputHandler.js"></script>
<script src="scripts/rendering/rendering2d.js"></script>
<script src="scripts/rendering/rendering1d.js"></script>
<script src="scripts/core/world.js"></script>
<script src="scripts/core/player.js"></script>
<script src="scripts/core/enemiesAndBullets.js"></script>
<script src="scripts/rendering/uiRenderer.js"></script>
<script src="scripts/utils/castRay.js"></script>
<script src="scripts/game.js"></script>
</body>
</html>