-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
73 lines (60 loc) · 2.12 KB
/
Copy pathindex.html
File metadata and controls
73 lines (60 loc) · 2.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="style.css" />
<title>Breakout!</title>
</head>
<body unselectable="on" onselectstart="return false;">
<div id="win" class="win">
<h2>You WIN !!!</h2>
<p id="scoreId"></p>
<button id="close-btn" class="btn noselect close-btn">OK</button>
</div>
<h1 id="title" class="noselect">Breakout!</h1>
<button id="rules-btn" class="btn rules-btn noselect">?</button>
<div id="rules" class="rules">
<div class="rules-info">
<h2>Created by Ivan Khizhnyak</h2>
</div>
<div class="rules-info">
<h3>How To Play:</h3>
<p>
Use your right and left keys to move the paddle to bounce the ball up
and break the blocks.
For phones: sensor to controll the paddle
</p>
<p>If you miss the ball, your score and the blocks will reset.</p>
</div>
<div class="rules-info">
<label for="">
Screen buttons:
<input id="scrnBtnsCheck" class="checkbox" type="checkbox" checked>
</label>
</div>
<button id="close-btn" class="btn noselect close-btn">OK</button>
</div>
<canvas id="canvas" class="noselect" width="800" height="600"></canvas>
<div id="btn-grup" class="btn-grup">
<button unselectable="on" onselectstart="return false;" id="leftBtn" class="btn noselect" ontouchend="btnUp()"
ontouchstart="btnDown('left')">←</button>
<button unselectable="on" onselectstart="return false;" id="rightBtn" class="btn noselect" ontouchend="btnUp()"
ontouchstart="btnDown('right')">→</button>
</div>
<script src="script.js"></script>
</body>
</html>
<!-- 1. Create canvas context
2. Create and draw ball
3. Create and draw paddle
4. Create bricks
5. Draw score
6. Add update() - Animate - requestAnimationFrame(cb)
7. Move paddle
8. Keyboard event handlers to move paddle
9. Move ball
10. Add wall bounderies
11. Increase score when bricks break
12. Lose - redraw bricks, reset score -->