本文实例为大家分享了jQuery实现飞机大战的具体代码,供大家参考,具体内容如下

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>飞机大战</title>
 <style>
 * {
  margin: 0px
 }

 .container {
  height: 700px;
  width: 500px;
  background-color: black;
  margin: 5px auto; /*上下外边距5px,左右自动*/
  position: relative;
 }

 .plane {
  height: 80px;
  width: 80px;
  /*background:bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;
  */
  background: url(images/plane.png) no-repeat center / 100% 100%;
  position: absolute;
  bottom: 10px;
  left: calc(50% - 40px);
 }

 .bullet {
  height: 10px;
  width: 5px;
  /*border-radius
  *每个半径的四个值的顺序是:左上角,右上角,右下角,左下角。
  *如果省略左下角,右上角是相同的。如果省略右下角,左上角是相同的。
  *如果省略右上角,左上角是相同的。
  */
  border-radius: 45% 45% 0 0;
  /*box-shadow: h-shadow v-shadow blur spread color inset;
  *h-shadow: 必需,水平阴影的位置
  *v-shadow: 必需,垂直阴影的位置
  *blur: 可选,模糊距离
  *spread: 可选,阴影的大小
  *color: 可选,阴影的颜色
  *inset: 可选,从外层的阴影(开始时)改变阴影内侧阴影
  */
  box-shadow: 0px 2px 10px orange;
  background: gold;
  position: absolute;
 }

 .enemy {
  height: 34.4px;
  width: 32.5px;
  /*background:bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;
  */
  background: url(images/enemy.png) no-repeat center / 100% 100%;
  transform: rotate(180deg);
  position: absolute;
  overflow: hidden;
  top: 0px;
 }

 h2 {
  height: 40px;
  display: table;
  border-color: deepskyblue;
  border-radius: 5px;
  background-color: deepskyblue;
  text-align: center;
  padding: 5px;
  position: relative;
  float: right;
  right: 300px;
 }
 </style>
 <!--引入jQuery-->
 <script src="/UploadFiles/2021-04-02/jquery-3.4.1.js">

更多有趣的经典小游戏实现专题,分享给大家:

C++经典小游戏汇总

python经典小游戏汇总

python俄罗斯方块游戏集合

JavaScript经典游戏 玩不停

java经典小游戏汇总

javascript经典小游戏汇总

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

标签:
jQuery,飞机大战

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
评论“jQuery实现简单飞机大战”
暂无“jQuery实现简单飞机大战”评论...

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。