Demo介绍
通过键盘点击下落小球所显示的数字,小球刷新再任意位置重新掉落。并且,每五个球后掉落速度加快
小球刷新位置 大小,颜色随机。用面向对象class方法实现
该demo源码可直接使用。赋值到html文件 然后打开就可以使用,可用作学校课设使用
源码
<!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>Document</title>
</head>
<style>
.title{
width: 1200px;
height: 80px;
margin:400px auto;
color: darkblue;
text-shadow: 3px 3px 3px black;
font-size: 80px;
font-weight: bolder;
text-align: center;
font-family: "楷体";
}
.name{
width: 1000px;
height: 40px;
margin:0 auto;
color: skyblue;
text-shadow: 3px 3px 3px black;
font-size: 40px;
font-weight: bolder;
text-align: center;
font-family: "楷体";
}
</style>
<body>
<div style="font-size: 40px;">当前分数<div class="score" >0</div></div&g