-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
285 lines (261 loc) · 14 KB
/
index.html
File metadata and controls
285 lines (261 loc) · 14 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html>
<head>
<title>Chen and Oran's Pacman </title>
<script src="./jquery-3.4.1.slim.min.js"></script>
<script type="text/javascript" src="./app.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="./UserManager.js"></script>
<script type="text/javascript" src="./about.js"></script>
<script type="text/javascript" src="./main.js"></script>
</head>
<body class="Site" onresize="resize_canvas()">
<img id="wall" src="images/back6.webp" alt="wall" width="220" height="277" style="display: none;">
<img id="medicine" src="images/medicine.jpg" alt="medicine" width="220" height="277" style="display: none;">
<img id="ghost" src="images/ghostRed.webp" alt="ghost" width="220" height="277" style="display: none;">
<img id="mon" src="images/covid19-cart.jpg" alt="mon" width="220" height="277" style="display: none;">
<img id="clock" src="images/stopwatch2.webp" alt="clock" width="220" height="277" style="display: none;">
<div id="menue_bar">
<menu type="toolbar" align="left">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" id="logopac" href="#">Pacman</a>
</div>
<button id="tabW" class="btn btn-info btn-lg" onclick="replaceWindow(event,'welcome')">Welcome</button>
<button id="tabR" class="btn btn-info btn-lg" onclick="replaceWindow(event,'register')">Register
</button>
<button id="tabL" class="btn btn-info btn-lg" onclick="replaceWindow(event,'login')">Login</button>
<button id="tabA" class="btn btn-info btn-lg" onclick="about()">About</button>
<button id="tabS" class="btn btn-info btn-lg" onclick="replaceWindow(event,'settings')" disabled="true">
Game settings
</button>
</div>
</nav>
</menu>
<p id="front_display" align="center"></p>
</div>
<main class="Site-content">
<!--alert-->
<div class='customAlert' id="alertmain">
<p class='message' id="msgmain"></p>
<input type='button' class='confirmButton' id="okalert" value='Ok'>
</div>
<div id="settings" class="tab" style="display:none;">
<script type="text/javascript" src="settings.js"></script>
<script type="text/javascript" src="jqueryvalidation.js"></script>
<h3>Game Settings </h3>
<h4>Change the game settings and click on "Start game"</h4><br>
<div id="keybuttons" align="center">
<strong>
<p id="keybuttonstxt">
♦ Choose Keys: Key Right →
<button id="rightkeybtn" class="btn btn-info btn-sm" onclick="chooseRight()" width="5%">Right
</button>
Key Left ←
<button id="leftkeybtn" class="btn btn-info btn-sm" onclick="chooseLeft()" width="5%">Left</button>
Key Up ↑
<button id="upkeybtn" class="btn btn-info btn-sm" onclick="chooseUp()" width="5%">Up</button>
Key Down ↓
<button id="downkeybtn" class="btn btn-info btn-sm" onclick="chooseDown()" width="5%">Down</button>
</p>
<p id="keyswarning"></p>
</strong>
</div>
<br>
<form id="settingsform" align="center">
<strong><p> ♦ Choose colors for balls:
5 points balls color: <input id="sixtyColor" type="color" value="#33ffbd">
10 points balls color: <input id="thirtyColor" type="color" value="#333EFF">
15 points balls color: <input id="tenColor" type="color" value="#FF333F"></p></strong>
<p id="colorswarning" style="margin-left:40%;"></p>
<strong>
<p>♦ Choose number of balls:
<input type="number" id="ballsnumin" name="ballsnumin" placeholder="min 50" size="2" min="50"
max="90" autocomplete="off">
<label for="ghostsNumber">♦ Choose number of ghosts:</label>
<select id="ghostsNumber" name="ghostsNumber" autocomplete="off">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select></p>
</strong>
<strong><p>♦ Choose time for the game:
<input type="number" id="timenumin" name="timenumin" placeholder="min 60" size="2" min="60"
autocomplete="off"></p>
</strong>
<button type="button" class="btn btn-info btn-lg" id="randomButton" onclick="randomInputs()">Randomize
</button>
<button type="submit" class="btn btn-danger btn-lg" id="startgame">Start game</button>
<!-- <button class="btn btn-info" id="startgame" onclick="showCanvas()" disabled>Start Game</button>-->
</form>
</div>
<div id="game" class="tab" onload="clearCanvas()">
<div id=playpause" class="controls">
<img src="images/play.webp" onclick="playPause()" id="play-pause" height="35" width="70" align="right"/>
</div>
<div id="labels" align="center">
<p>
<label for="lblScore">SCORE:</label>
<input id="lblScore" type="text"/>
<label for="lblTime">TIME:</label>
<input id="lblTime" type="text"/>
<label for="lblLifes" width="10px">LIVES:</label>
<input id="lblLifes" type="text"/>
</p>
</div>
<div class="wrapper" style="position: relative;">
<div id="can">
<canvas id="canvas" style="border: none;" width="600" height="600" align="right"></canvas>
</div>
<div class="controls" id="ctrl" style="position: fixed; top:110px;">
<p align="center">
<button class="btn btn-info" id="reset" onclick="reset()">New game</button>
<button class="btn btn-danger" id="pause" onclick="pauseGame()">Pause</button>
</p>
<br>
<div id="showsettings" align="center">
<h5>Settings</h5>
<strong><p id="showSettingsKeys"></p>
<p id="showSettings5points" style="margin: 0; display: inline" ;></p>
<p id="showSettings10points" style="margin: 0; display: inline" ;></p>
<p id="showSettings15points" style="margin: 0; display: inline" ;></p>
<p id="showSettingsNums"></p>
</strong></div>
<br>
<br>
<br>
</div>
</div>
<audio autoplay loop src="music/PacMan.mp3" id="music"></audio>
<audio src="music/gameover.mp3" id="diemusic"></audio>
<audio src="music/we-did-it_1.mp3" id="winmusic"></audio>
<audio src="music/pacman_death.wav" id="ghostmusic"></audio>
<!--alert-->
<div class='customAlert' id="alertgame">
<p class='message' id="msggame"></p>
<input type='button' class='confirmButton' id="okalertgame" value='Ok'>
</div>
</div>
<div id="welcome" class="tab" align="center">
<div class="imgcontainer" id="welcomeCon">
<br>
<img class="images" src="images/logopac.png" id="logo" alt="images" width="460" height="250"
margin-left=30%>
<br>
<br>
<button id="reg" class="btn btn-info btn-lg" onclick="replaceWindow(event,'register')" align="center">
Register
</button>
<button id="log" class="btn btn-info btn-lg" onclick="replaceWindow(event,'login')" align="center">Login
</button>
</div>
</div>
<div id="register" class="tab" style="display:none;">
<script type="text/javascript" src="jqueryvalidation.js"></script>
<script type="text/javascript" src="form.js"></script>
<script type="text/javascript" src="dobpicker.js"></script>
<link rel="stylesheet" type="text/css" href="styleLogin.css"/>
<form id="reg_form" style="border:1px solid #ccc">
<div class="container" id="containerForm">
<strong><h1>Register</h1></strong>
<img class="images" src="images/packman.webp" alt="packman" width="50" height="50">
<strong><p> Please fill in this form to create a new account for playing our game </p></strong>
<p>
---------------------------------------------------------------------------------------------------</p>
<!-- <hr>-->
<label for="uname_reg"><b>Username </b></label>
<input type="text" placeholder="Enter Username" id="uname_reg" name="uname_reg" size="45">
<br>
<label for="psw_reg"><b>Password </b></label>
<input type="password" placeholder="Enter Password" id="psw_reg" name="psw_reg" size="45">
<br>
<label for="fname_reg"><b>Full Name </b></label>
<input type="text" placeholder="Enter Full Name" id="fname_reg" name="fname_reg" size="45">
<br>
<label for="email_reg"><b>Email </b></label>
<input type="email" placeholder="Enter Email" id="email_reg" name="email_reg" size="45">
<br>
<label for="bdate_reg" id="bdate_reg">Birth date</label>
<select id="Bday" name="Bday" class='group'></select>
<select id="Bmonth" name="Bmonth" class='group'></select>
<select id="Byear" name="Byear" class='group'></select>
<div class="clearfix">
<button type="submit" class="btn btn-info btn-lg" id="submit_reg">Register</button>
<br>
<button type="button" onclick="replaceWindow(event,'welcome')" class="btn btn-danger btn-lg">Cancel
</button>
</div>
</div>
</form>
</div>
<div id="login" class="tab" style="display:none;">
<link rel="stylesheet" type="text/css" href="styleLogin.css"/>
<form margin-left=40% margin-right=40%>
<strong><h1>Login</h1></strong>
<div class="imgcontainer">
<img src="images/avatar2.webp" alt="Avatar" class="avatar">
</div>
<div class="container" id="containerForm2">
<label for="uname_log"><b>Username</b></label>
<input type="text" placeholder="Enter Username" id="uname_log" name="uname_login" required
align="center"
size="40">
<br>
<label for="psw_log"><b>Password</b></label>
<input type="password" placeholder="Enter Password" id="psw_log" name="psw_login" required
align="center"
size="40">
<br>
<div class="clearfix">
<button type="button" class="btn btn-info btn-lg" onclick="userManagerLogin()">Login</button>
<br>
<button type="button" onclick="replaceWindow(event,'welcome')" class="btn btn-danger btn-lg"
align="center">Cancel
</button>
</div>
</div>
</form>
</div>
<div id="about" class="modal">
<link rel="stylesheet" type="text/css" href="styleModal.css"/>
<div class="modal-content">
<span class="close">×</span>
<img class="images" src="images/packman.webp" alt="packman" width="20" height="20" align="left">
<img class="images" src="images/packman.webp" alt="packman" width="20" height="20" align="right">
<strong><h2>About the game</h2></strong>
<p>This pacman game was created by Oran and Chen.</p>
<p>The challenges we encountered while creating the game:<br>
In general, we discovered that there were many options to accomplish every feature,
so we had to try different things until we found the one that worked best. For example, overriding
window alerts.
<br>In Addition, we found it a bit hard to fit the canvas to the window size.</p>
<p>Use of Jquery Plugin: "jqueryvalidation.js" - for registration and settings form validation,
"dobpicker.js"
- for picking birth date in the registration form.</p>
<img class="images" src="images/packman.webp" alt="packman" width="20" height="20" align="left">
<img class="images" src="images/packman.webp" alt="packman" width="20" height="20" align="right">
<br>
</div>
</div>
</main>
<div class="footer">
<div id="footerright">
<div id=ftrcontact">
<strong><p>Contact us at: <br>
Chen: <a href="mailto:chengal@post.bgu.ac.il">chengal@post.bgu.ac.il </a>
<br>Oran: <a href="mailto:shichman@post.bgu.ac.il">shichman@post.bgu.ac.il </a></p></strong>
</div>
</div>
<div id="footerleft">
<br>
<strong> © All rights reserved to Chen Galed and Oran Shichman </strong>
<p>Created on April,2020.</p>
</div>
</div>
</body>
</html>