7879808182838485868788
area.intersect(new Area(obj.getRectangle())); if((obj instanceof Hittable) && !area.isEmpty() && link != obj) { Hittable hittable = (Hittable)obj; hittable.hitBy(Weapon.SWORD); } } } @Override
139140141142143144145146147148149
public void collision(GObject obj) { if (obj instanceof Hittable && !(obj instanceof Link) && !(obj instanceof Bush)) { Hittable hittable = (Hittable)obj; hittable.hitBy(Weapon.ARROW); alive = false; arrowHitSomething(); } if(obj instanceof Guard)
8384858687888990919293
area.intersect(new Area(obj.getRectangle())); if((obj instanceof Hittable) && !area.isEmpty() && this != obj) { Hittable hittable = (Hittable)obj; hittable.hitBy(Weapon.BOMB); } } game.getScene().removeHitter(bomb); }