-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-bundle.html
More file actions
153 lines (152 loc) · 3.94 KB
/
index-bundle.html
File metadata and controls
153 lines (152 loc) · 3.94 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>First Person 3D World</title>
<style>
body {
margin: 0;
overflow: hidden;
font-family: Arial, sans-serif;
background: #000;
}
#gameCanvas {
display: block;
width: 100vw;
height: 100vh;
}
#info {
position: absolute;
top: 10px;
left: 10px;
color: white;
background: rgba(0, 0, 0, 0.7);
padding: 15px;
border-radius: 5px;
font-size: 14px;
line-height: 1.6;
}
#crosshair {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 20px;
height: 20px;
pointer-events: none;
}
#crosshair::before,
#crosshair::after {
content: '';
position: absolute;
background: rgba(255, 255, 255, 0.8);
}
#crosshair::before {
width: 2px;
height: 20px;
left: 9px;
top: 0;
}
#crosshair::after {
width: 20px;
height: 2px;
left: 0;
top: 9px;
}
#hitmarker {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 40px;
height: 40px;
pointer-events: none;
opacity: 0;
transition: opacity 0.1s;
}
#hitmarker.active {
opacity: 1;
}
#hitmarker::before,
#hitmarker::after {
content: '';
position: absolute;
background: white;
width: 3px;
height: 15px;
}
#hitmarker::before {
top: 0;
left: 50%;
transform: translateX(-50%) rotate(45deg);
}
#hitmarker::after {
bottom: 0;
left: 50%;
transform: translateX(-50%) rotate(45deg);
}
#healthBar {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
width: 300px;
height: 30px;
background: rgba(0, 0, 0, 0.7);
border: 2px solid #fff;
border-radius: 5px;
overflow: hidden;
}
#healthFill {
height: 100%;
width: 100%;
background: linear-gradient(90deg, #ff0000, #ff6666);
transition: width 0.3s;
}
#ammoCounter {
position: absolute;
bottom: 20px;
right: 20px;
color: white;
background: rgba(0, 0, 0, 0.7);
padding: 15px;
border-radius: 5px;
font-size: 24px;
font-weight: bold;
font-family: monospace;
}
#weapon {
position: absolute;
bottom: 60px;
right: 20px;
color: #ffa500;
font-size: 16px;
font-weight: bold;
}
</style>
</head>
<body>
<canvas id="gameCanvas"></canvas>
<div id="crosshair"></div>
<div id="hitmarker"></div>
<div id="healthBar">
<div id="healthFill"></div>
</div>
<div id="ammoCounter">
<div id="weapon">🔫 PISTOL</div>
<span id="ammo">30</span> / <span id="ammoTotal">120</span>
</div>
<div id="info">
<strong>Cube World FPS</strong><br>
FPS: <span id="fps">60</span><br>
WASD - Move<br>
Mouse - Look around<br>
Space - Jump<br>
Left Click - Shoot<br>
R - Reload<br>
Click to start
</div>
<script src="game-bundle.js"></script>
</body>
</html>