-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
114 lines (92 loc) · 5.21 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
<!--All images and audio are not my property. All credits to its official owner-->
<!--Sources of image: Flaticon, Opengameart
Souces of audio: Opengameart-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Falling Game</title>
<!--Website icon-->
<link rel="shortcut icon" type="image/png" href="icon.png">
<!--Tailwind css and style sheet-->
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"/>
<!--Google Fonts-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Genos:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Aldrich&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bungee+Inline&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Holtwood+One+SC&display=swap" rel="stylesheet">
</head>
<body>
<div id="holder">
<!-- adding a UI panel to display the score and the start button -->
<div class="absolute inset-0 flex justify-center items-center z-10" id="modalEl">
<div class="max-w-md w-full p-6 text-center" style="background-color: brown;">
<h1 class="text-4xl font-bold select-none" id="title">F a l l i n g B a l l</h1>
<div class="py-1 text-lg select-none" id="instruction">
<p>Run away from the spooky-spikes <br> How to Play?</p>
<div class="flex items-center justify-center">
<img src="left-arrow.png" alt="left Arrow Key" width="15">
<p> : Press left-arrow key to move left</p>
</div>
<div class="flex items-center justify-center">
<img src="right-arrow.png" alt="Right Arrow Key" width="15">
<p> : Press right-arrow key to move right</p>
</div>
<br>
<p>Click on 'Use Touchpad' to use the onscreen controls</p>
</div>
<p class="text-4xl font-bold select-none" id="gameovertxt">G a m e O v e r</p>
<h1 class="text-4xl font-bold select-none" id="bigScoreEl">0</h1>
<p class="text-m text-gray-600 mb-4" id="textScoreEl">Your Score</p>
<h1 class="text-4xl font-bold leading-none" id="bigHighScoreEl" style="font-family: 'Bungee Inline', cursive; color: khaki;"></h1>
<p class="text-m text-gray-600 mb-4" style="font-family: 'Genos', sans-serif; color: cornsilk;">High Score</p>
<p class="text-3xl text-gray-600 mb-4" id="newHighScoreText">!! New High Score !!</p>
<div>
<button class="w-full py-3 rounded-full text-m select-none focus:outline-none" id="startGameBtn" style="font-family: 'Aldrich', sans-serif; background-color: gold; color: brown;">S t a r t</button>
</div>
<div>
<button class="w-full rounded-full text-m select-none py-2 mt-2 focus:outline-none" id="instBtn">I n s t r u c t i o n s</button>
</div>
</div>
</div>
<!--Game board-->
<div id="gameboard">
<div class="grid grid-cols-2 grid-rows-1">
<div class="text-m select-none" id="scoreDisplay">
<span>Score: </span>
<span id="scoreEl">0</span>
</div>
<div class="text-right text-m select-none" id="highscoreDisplay">
<span>Best: </span>
<span id="highscoreEl"></span>
</div>
</div>
<div class="w-400 h-511" id="board">
<div id="spikes"></div>
<div id="game">
<div id="character"></div>
</div>
<div id="platform"></div>
</div>
<div class="flex items-center justify-center">
<button class="text-center text-lg m-auto select-none focus:outline-none" id="usetouchpad">+ Use Touchpad</button>
</div>
<div class="w-200 h-20 grid grid-cols-2 grid-rows-1 gap-x-32 content-center" id="touchpad" style="visibility: hidden;">
<button class="m-auto mr-0 w-20 select-none focus:outline-none" id="left">
<img src="left-arrow-ui.png" alt="left-arrow">
</button>
<button class="m-auto ml-0 w-20 select-none focus:outline-none" id="right">
<img src="right-arrow-ui.png" alt="right-arrow">
</button>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>