-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path俄罗斯方块.html
49 lines (44 loc) · 1004 Bytes
/
俄罗斯方块.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
<!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">
<title>canvas</title>
<style>
#myCanvas {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
background: #000;
}
</style>
</head>
<body>
<canvas id="myCanvas" height="500" width="500"></canvas>
<button id="stop">停止</button>
<button id="score">得分: 0</button>
<script>
window.onload = function(){
let ELS = {
init(){
const canvas = document.querySelector('#myCanvas');
this.ctx = canvas.getContext('2d');
this.render();
},
map(r,c){
},
render(){
this.ctx.fillStyle = 'red';
this.ctx.fillRect(100,100,40,40);
}
}
console.log(ELS)
ELS.init();
}
</script>
</body>
</html>