public boolean hitWall(Wall w) { if (this.isLive() && this.getRect().intersects(w.getRect())) { this.live = false; return true; } return false; }
// 碰撞测试判断,是否与墙撞了 public boolean collidesWithWall(Wall w) { if (this.tlive && this.getRect().intersects(w.getRect())) { this.stay(); return true; } ; return false; }