-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
97 lines (84 loc) · 3.55 KB
/
index.html
File metadata and controls
97 lines (84 loc) · 3.55 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PacMania</title>
<style>
/* Base Reset & Background */
html, body {
margin: 0; padding: 0; overflow: hidden;
background: #111;
font-family: 'Times New Roman', serif;
}
/* UI Overlay Container */
#ui-layer {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
pointer-events: none; display: flex; flex-direction: column; justify-content: space-between;
}
/* Score Display */
#score-container {
text-align: center; margin-top: 20px; color: #fff;
font-size: 32px; font-weight: bold; text-shadow: 2px 2px 0 #000; letter-spacing: 2px;
}
/* Lives Display */
#lives-container {
margin: 20px; display: flex; align-items: center;
}
.life-icon {
width: 30px; height: 30px;
background: radial-gradient(circle at 30% 30%, #ffd700, #daa520);
border-radius: 50%; margin-right: 10px;
box-shadow: 2px 2px 5px rgba(0,0,0,0.5); position: relative;
}
.life-icon::after {
content: ''; position: absolute; top: 20%; right: 0; width: 40%; height: 60%;
background: #111; clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
/* Control Hints */
#controls-hint {
position: absolute; top: 10px; right: 10px;
color: rgba(255,255,255,0.5); font-family: sans-serif; font-size: 12px; text-align: right;
}
/* Game Over & Win Screens */
.overlay-screen {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; display: none; z-index: 10;
}
.title-text {
font-size: 60px; text-shadow: 4px 4px #000;
font-weight: 900; font-family: sans-serif; margin-bottom: 20px;
}
#game-over .title-text { color: #ff0000; }
#game-win .title-text { color: #ffd700; }
/* Interactive Buttons */
.restart-btn {
pointer-events: auto;
background: #fff; color: #000; border: 4px solid #000;
padding: 10px 20px; font-size: 20px; font-weight: bold;
cursor: pointer; text-transform: uppercase;
box-shadow: 4px 4px 0 #555;
}
.restart-btn:hover { background: #eee; transform: translate(2px, 2px); box-shadow: 2px 2px 0 #555; }
canvas { display: block; }
</style>
<script src="https://cdn.jsdelivr.net/npm/gl-matrix@3.4.3/gl-matrix-min.js"></script>
</head>
<body>
<div id="ui-layer">
<div id="score-container"><span id="score">000000</span></div>
<div id="lives-container"></div>
</div>
<div id="controls-hint">Arrows: Move | Space: Jump | V: Shear View | S: Sound</div>
<div id="game-over" class="overlay-screen">
<div class="title-text">GAME OVER</div>
<button class="restart-btn" onclick="restartGame()">Try Again</button>
</div>
<div id="game-win" class="overlay-screen">
<div class="title-text">YOU WIN!</div>
<div style="color:white; font-size: 20px; margin-bottom: 20px;">ALL DOTS COLLECTED</div>
<button class="restart-btn" onclick="restartGame()">Play Again</button>
</div>
<canvas id="glcanvas"></canvas>
<script type="module" src="./main.js"></script>
</body>
</html>