import java.awt.*; public class Pall{ double x, y; double sammX, sammY; int r=5; public Pall(int ux, int uy){ x=ux; y=uy; } public int kysiX(){return (int)x;} public int kysiY(){return (int)y;} public void liigu(){ x+=sammX; y+=sammY; } public void uusKiirus(double dx, double dy){ sammX=dx; sammY=dy; } public void joonista(Graphics g){ g.setColor(Color.BLACK); g.fillOval(kysiX()-r, kysiY()-r, 2*r, 2*r); } }