0 Star 0 Fork 0

kong1987/WC的基础功能实现

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test4.java 611 Bytes
一键复制 编辑 原始数据 按行查看 历史
package com.kong.shoot;
import java.awt.image.BufferedImage;
public abstract class FlyingObject {
//图片坐标
protected int x;
protected int y;
//图片大小
protected int width;
protected int heigth;
//图片
protected BufferedImage image;
//物体移动
public abstract void step();
//检查是否越界
public abstract boolean outOfBounds();
public boolean shootBy(Bullet bullet)
{
int x1=this.x;
int x2=this.x+this.width;
int y1=this.y;
int y2=this.y+this.heigth;
int x=bullet.x;
int y=bullet.y;
return x>x1 && x<x2
&&
y>y1 && y<y2;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/kong1987/wc.git
git@gitee.com:kong1987/wc.git
kong1987
wc
WC的基础功能实现
master

搜索帮助