这是我的Bullet类的当前代码,但我不知道如何进行碰撞检测以及该指令应该转化为什么?如果你能帮我翻译一下,感谢很多!!
public class Bullet extends MovingImage {
int x, y;
boolean visible;
public Bullet(int startX, int startY) {
super("FireBall.gif", startX, startY, 30, 10);
x = startX;
y = startY;
visible = true;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public boolean getVisible() {
return visible;
}
public void move() {
x = x + 2;
if (x > 700)
visible = false;
}
public boolean checkCollision(MovingImage pixeldude) {
if(bullet)
return visible;
// Check if this bullet is inside of dude
// If so, return true
// If not, return false
}
}