基本信息
源码名称:java 飞机大战 游戏源码下载
源码大小:12.39M
文件格式:.rar
开发语言:Java
更新时间:2017-12-04
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

 经典飞机大战,通过鼠标移动控制飞机移动击落敌机获得得分,在击落敌机的同时注意规避敌机子弹,在飞行过程中随机掉落道具,子弹增加,以及补充血量,清屏敌机。在击落boss后游戏通关。

学习线程的经典案例


//子弹撞敌机
public boolean bulletEp(Bullet bullet){
boolean f=false;
if(bullet.isLive){
if(bullet.x bullet.bImg.getWidth(null)>=x&&bullet.x<=x img.getWidth(null)
&&bullet.y>=y&&bullet.y<=y img.getHeight(null)){
if(isLive){
hp--;
}
bullet.isLive=false;
if(hp==0){
            time--;
isLive=false;
f=true;
}
}

}
return f;
}
//英雄级撞敌机
public boolean heroEnemy(ShootJPanel panel){
boolean f=false;
if(panel.hx panel.p[0].getWidth()/2>=x&&panel.hx panel.p[0].getWidth()/2<=x img.getWidth(null)
&&panel.hy panel.p[0].getHeight()/2>=y&&panel.hy panel.p[0].getHeight()/2<=y img.getHeight(null)){
if(isBoss){
panel.isLive=false;
panel.hhp=0;
}else{ 
 if(isLive)
 panel.hhp--;
 isLive=false;
 img=new ImageIcon("images/blast/blast_1.png").getImage();
 if(panel.hhp==0){
 panel.isLive=false;
 f=true;
     }
   }
  }
return f;
}
//英雄机吃道具
  public boolean eatAward(ShootJPanel panel){
 boolean f=false;
 if(panel.hx panel.p[0].getWidth()/2>=x&&panel.hx panel.p[0].getWidth()/2<=x img.getWidth(null)
&&panel.hy panel.p[0].getHeight()/2>=y&&panel.hy panel.p[0].getHeight()/2<=y img.getHeight(null)){
 f=true;
 isLive=false;
 }
 return f;
  }