-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
133 lines (128 loc) · 4.2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bean (balancing fixes)</title>
<style>
body {
margin: 0;
overflow: hidden;
background-color: #000;
font-family: Arial, sans-serif;
}
canvas {
display: block;
}
#score, #health, #currency, #gameOver {
position: absolute;
color: white;
font-size: 20px;
top: 10px;
}
#score {
left: 10px;
}
#health {
left: 10px;
top: 40px;
}
#currency {
left: 10px;
top: 70px;
}
#gameOver {
display: none;
top: 100px;
left: 10px;
font-size: 30px;
color: red;
}
#shopContainer {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
color: white;
text-align: center;
padding-top: 50px;
flex-direction: column;
justify-content: center;
align-items: center;
}
#shopContainer .shop-item {
margin-bottom: 20px;
padding: 15px;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 10px;
width: 300px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
#shopContainer .shop-button {
padding: 8px 15px;
background-color: #28a745;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#shopContainer .shop-button:hover {
background-color: #218838;
}
#shopContainer .shop-item span {
font-weight: bold;
font-size: 16px;
}
.Inventory {
font-size: 16px;
padding: 10px 20px;
background-color: #FF0000;
color: black;
border: none;
border-radius: 5px;
cursor: pointer;
position: absolute;
top: 20px;
transition: background-color 0.3s ease;
}
.resume-button:hover {
background-color: #333;
}
</style>
</head>
<body>
<div id="score">Score: 0</div>
<div id="health">HP: 100</div>
<div id="currency">Currency: 0</div>
<div id="gameOver">Game Over</div>
<div id="shopContainer">
<button class="Inventory" onclick="openInventory()">Open Your Inventory</button>
<div class="shop-item">Heal HP (+50) ($50) <button class="shop-button" onclick="buyHealthUpgrade()">Buy</button></div>
<div class="shop-item">Increase Bullet Speed ($100) <button class="shop-button" onclick="buyBulletSpeedUpgrade()">Buy</button></div>
<div class="shop-item">Increase Player Speed ($100) <button class="shop-button" onclick="buyPlayerSpeedUpgrade()">Buy</button></div>
<div class="shop-item">Shotgun ($100) <button class="shop-button" onclick="buyShotgun()">Buy</button> <span id="shotgunStatus">Not Purchased</span></div>
<div class="shop-item">Minigun ($500) <button class="shop-button" onclick="buyMinigun()">Buy</button> <span id="minigunStatus">Not Purchased</span></div>
<div class="shop-item">Sniper ($500) <button class="shop-button" onclick="buySniper()">Buy</button> <span id="sniperStatus">Not Purchased</span></div>
</div>
<canvas id="gameCanvas"></canvas>
<script src="game.js"></script>
<script>
function showShop() {
gamePaused = true;
document.getElementById('shopContainer').style.display = 'flex';
}
function hideShop() {
gamePaused = false;
document.getElementById('shopContainer').style.display = 'none';
gameLoop(); // Restart the game loop
}
</script>
</body>
</html>