77787980818283848586
area.add(new Area(sword)); area.intersect(new Area(obj.getRectangle())); if((obj instanceof Hittable) && !area.isEmpty() && link != obj) { Hittable hittable = (Hittable)obj; hittable.hitBy(Weapon.SWORD); } } }
138139140141142143144145146147148149
@Override 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)
828384858687888990919293
area.add(new Area(bomb)); 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); }