import java.awt.*; public class Banaan extends Kujund{ int r=3; public Banaan(int ux, int uy, double dx, double dy){ muudaAsukoht(ux, uy); muudaKiiruseSamm(dx, dy); } public void joonista(Graphics g){ g.drawRect(kysiX()-r, kysiY()-2*r, 2*r, 4*r); } public boolean kasPihtas(int hx, int hy){ return (hx > x-r && hx < x+r && hy > y-2*r && hy < y+2*r); } }