-
Notifications
You must be signed in to change notification settings - Fork 1
/
brick.html
32 lines (28 loc) · 909 Bytes
/
brick.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
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="paddle.js"></script>
<script type="text/javascript" src="ball.js"></script>
<script type="text/javascript" src="brick.js"></script>
<link rel="stylesheet" type="text/css" href="brick.css">
<script>
$(function() {
$('.start').on('click', function (event) {
var mousePosition = event.clientX;
attachMouseToPaddle(mousePosition);
dropBall();
$(this).addClass('on').hide();
});
});
</script>
</head>
<body>
<div class="game" id="bounceArea">
<div class="paddle" id="paddle"></div>
<button class="start">Start</button>
</div>
<div class="ball" id="ball"></div>
<div class="score" id="score">0</div>
</body>
</html>