import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.util.Vector; public class vann3 extends Applet implements KeyListener{ Graphics g; int vann_x1=10, vann_x2=160; int vann_y1=50, vann_y2=100; int vann_pooly=vann_y2-vann_y1/2; int pea_x=10, pea_y=0; public vann3(){ addKeyListener(this); } public void paint(Graphics g){ //vann g.drawLine(vann_x1, vann_y1, vann_x2, vann_y1); //äär g.drawLine(vann_x1, vann_y2, vann_x2, vann_y2); //p6hi g.drawLine(vann_x1, vann_y1, vann_x1, vann_y2); //vasak kylg g.drawLine(vann_x2, vann_y1, vann_x2, vann_y2); //parem kylg g.setColor(Color.red); g.drawOval(pea_x, pea_y, 20, 20); //pea g.drawLine(pea_x+10, pea_y+20, pea_x+15, pea_y+40); //selgroog g.drawLine(pea_x+10, pea_y+20, pea_x+20, pea_y+40); //parem kasi g.drawLine(pea_x+10, pea_y+20, pea_x+10, pea_y+40); //vasak kasi g.drawLine(pea_x+15, pea_y+40, pea_x+30, pea_y+70); //1 jalg g.drawLine(pea_x+15, pea_y+40, pea_x+20, pea_y+70); //2 jalg g.setColor(Color.blue); g.drawLine(vann_x1, vann_pooly, vann_x2, vann_pooly); } public void keyPressed(KeyEvent k){ int kood=k.getKeyCode(); if(kood==KeyEvent.VK_DOWN){ for(int pea_y=0; pea_y+70