1 Star 0 Fork 0

Qiao/飞机大战

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Bee.java 788 Bytes
一键复制 编辑 原始数据 按行查看 历史
李帛峭 提交于 2021-04-13 20:04 . 飞机大战
public class Bee extends FuPlane implements Enemy{
private int xspeed = 4;
private int yspeed = 2;
private int score = 5;
public Bee() {
blood = 1;
img = Main.bee;
height = img.getHeight();
width = img.getWidth();
x = (int) (Math.random() * 400 - img.getWidth());
y = -img.getHeight();
}
public int getScore(){
return score;
}
public void setScore(int score){
this.score =score;
}
@Override
void move() {
/*
蜜蜂x,y坐标增大,当x碰到边界,x反向
*/
x += xspeed;
y += yspeed;
if (x >= Main.WIDTH - img.getWidth()) {
xspeed = -4;
}
if (x <= 0) {
xspeed = 4;
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/li-boqiao/BoQiao.git
git@gitee.com:li-boqiao/BoQiao.git
li-boqiao
BoQiao
飞机大战
master

搜索帮助