加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fjdz.html 2.86 KB
一键复制 编辑 原始数据 按行查看 历史
7k 提交于 2022-05-25 15:41 . js飞机大战
<!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>飞机大战</title>
<script src="js/fj.js"></script>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
background:url(./img/background_1.png);
/* animation:infinite 5s; */
height: 100vh;
overflow: hidden;
}
/* @keyframes a {
0%{background-position: 0 0 ;}
100%{background-position: 0 -100% ;}
} */
#myPlane{
width: 66px;
height: 80px;
position: absolute;
/* cursor: none; */
}
#myPlane img{
width: 100%;
height: 100%;
}
.bullet{
width: 6px;
height: 14px;
position: absolute;
margin-right: 12px;
}
.bullet2{
width: 6px;
height: 14px;
margin-left: 8px;
position: absolute;
}
.bullet3{
width: 6px;
height: 14px;
position: absolute;
}
.enemy{
position: absolute;
}
#ks{
width: 200px;
height: 60px;
text-align: center;
line-height: 60px;
color: chartreuse;
background-color: rgb(0, 242, 255,.5);
font-size: 24px;
float: right;
display: block;
}
#ks1{
width: 200px;
height: 60px;
text-align: center;
line-height: 60px;
color: chartreuse;
background-color: rgb(0, 242, 255,.5);
font-size: 24px;
float: right;
margin-top: 30px;
margin-left: 2000px;
display: block;
}
#ks2{
width: 160px;
height: 80px;
border-radius: 40%;
background-color: rgb(0, 200, 255,.5);
text-align: center;
line-height: 80px;
color: chartreuse;
font-size: 24px;
margin: 300px 700px;
position: absolute;
cursor: pointer;
}
</style>
</head>
<body>
<div id="myPlane">
<img src="./img/我的飞机.gif" >
</div>
<!-- 子弹容器 -->
<div id="bulletBox">
<!-- <img src="./img/bullet1.png" class="bullet">
<img src="./img/bullet2.png" class="bullet2">
<img src="./img/bullet3.png" class="bullet3"> -->
</div>
<!-- 敌机容器 -->
<div id="enemyBox"></div>
<div id="ks">生命值:3</div>
<div id="ks1">分数:0</div>
<div id="ks2">游戏开始</div>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化