62,614
社区成员
发帖
与我相关
我的任务
分享
private boolean checkCollide(Bullet bullet, Object getMethod) {
if(getMethod instanceof Polygon) {
return this.getPoly().intersects(bullet.getRect());
}
if(getMethod instanceof Rectangle){
return this.getRect().intersects(bullet.getRect());
}
}
private boolean checkCollide(Bullet bullet, Object getMethod) {
boolean temp = false;
if(getMethod instanceof Polygon) {
temp = this.getPoly().intersects(bullet.getRect());
}
if(getMethod instanceof Rectangle){
temp = this.getRect().intersects(bullet.getRect());
}
return temp;
}