Skip to content

Commit e643128

Browse files
Merge pull request #160 from DinethShakya23/feature/gravity-flip-pinball
feat: add Gravity Flip Pinball game – control gravity to guide the ball
2 parents 493d888 + becde7f commit e643128

File tree

4 files changed

+826
-3
lines changed

4 files changed

+826
-3
lines changed

data/projects.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@
208208
"difficulty": "easy"
209209
},
210210
{
211-
212211
"title": "Tip Calculator",
213212
"slug": "Tip Calculator",
214213
"description": "Calculate tips and divide bills accurately in seconds",
@@ -217,14 +216,12 @@
217216
"difficulty": "easy"
218217
},
219218
{
220-
221219
"title": "Hangman Game",
222220
"slug": "hangman",
223221
"description": "A two player word guessing game where one enters a secret word and the other tries to guess it.",
224222
"category": "Small Games",
225223
"categoryKey": "games",
226224
"difficulty": "medium"
227-
228225
},
229226
{
230227
"title": "Orbit Game",
@@ -257,5 +254,13 @@
257254
"category": "productivity",
258255
"categoryKey": "productivity",
259256
"difficulty": "intermediate"
257+
},
258+
{
259+
"title": "gravity-flip-pinball",
260+
"slug": "gravity-flip-pinball",
261+
"description": "A simple pinball game where you control gravity to move the ball and score by passing through gates.",
262+
"category": "Small Games",
263+
"categoryKey": "games",
264+
"difficulty": "haed"
260265
}
261266
]
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Gravity Flip Pinball</title>
7+
<link rel="stylesheet" href="style.css" />
8+
</head>
9+
<body>
10+
<div class="hud">
11+
<h1>Gravity Flip Pinball</h1>
12+
<div class="hud-row">
13+
<span class="hud-label">Score:</span>
14+
<span class="hud-value" id="score">0</span>
15+
</div>
16+
<div class="hud-row">
17+
<span class="hud-label">Gates:</span>
18+
<span class="hud-value" id="gates">0/3</span>
19+
</div>
20+
<div class="hud-row">
21+
<span class="hud-label">Status:</span>
22+
<span class="hud-value" id="status">Ready</span>
23+
</div>
24+
<div class="controls">
25+
<button id="startBtn" class="btn">Start</button>
26+
<button id="replayBtn" class="btn">Replay</button>
27+
</div>
28+
<p class="hint">
29+
W/A/S/D — change gravity<br />
30+
Double-click canvas to quick reset
31+
</p>
32+
</div>
33+
34+
<div class="mode-toggle">
35+
<label>
36+
<input type="checkbox" id="challengeMode" />
37+
<span>Challenge Mode (60s)</span>
38+
</label>
39+
</div>
40+
41+
<div class="timer-display" id="timer">60</div>
42+
43+
<div class="gravity-indicator">
44+
<button class="gravity-btn" data-key="w"></button>
45+
<button class="gravity-btn" data-key="a"></button>
46+
<button class="gravity-btn" data-key="s"></button>
47+
<button class="gravity-btn" data-key="d"></button>
48+
</div>
49+
50+
<div class="victory-modal" id="victoryModal">
51+
<h2 id="victoryTitle">Victory!</h2>
52+
<p id="victoryMessage">You collected all gates and reached the end!</p>
53+
<button class="btn" onclick="replay()">Play Again</button>
54+
</div>
55+
56+
<canvas id="gameCanvas"></canvas>
57+
<script src="script.js"></script>
58+
</body>
59+
</html>

0 commit comments

Comments
 (0)