public void paint (Graphics g ){
q.draw(g, i, h);i=i+3;
if(i==921)i=0;
b.draw(g, x, y);
u.draw(g, c , x, y, k4);
u1.draw(g,c1 , x, y);
u2.draw(g,c2 , x, y);
u3.draw(g,c3 , x, y);
u4.draw(g,c4 , x, y);
if(haus2){g.setColor(Color.white);
g.fillRect(400, 300, 100, k2*30);}
if(haus3){g.setColor(Color.white);
g.fillRect(550, 200, 50, k3*40);}
if(haus4){g.setColor(Color.white);
g.fillRect(750, 380, 70, 20+k4*20);
g.setColor(Color.blue);
g.fillOval(740,385+k4*20,20,20);
g.setColor(Color.white);
g.fillOval(735,380+k4*20,20,20);}
if(haus5){g.setColor(Color.white);
g.fillRect(300, 200, 50, k5*40);}
if(haus1){g.setColor(Color.white);
g.fillRect(100, 400, 33, k1*20);}
if (v){ //Bombe werfen
ü.draw(g, i, a);
a=a+12;
try {
Robot robot = new Robot();
Color col = robot.getPixelColor(910-i-1, h+a+70);
if(col.getBlue()!= 255 & col.getRed()!=255 & col.getGreen()!= 255){
g.setColor(c);
g.fillOval(890-i, 90+a, 40, 40);
v=false;a=0;
if (i<=200){ int rot=r.nextInt(255);//CopyofGebäude
int grün=r.nextInt(255);
int blau=r.nextInt(255);
c= new Color(rot,grün,blau);haus4=true;k4=k4+1;}
if (400>=i & i>=300){ int rot1=r.nextInt(255);//CopyofGebäude1
int grün1=r.nextInt(255);
int blau1=r.nextInt(255);
c2= new Color(rot1,grün1,blau1);haus3=true;k3=k3+1;
}
if (550>=i & i>=400){ int rot2=r.nextInt(255);//CopyofGebäude3
int grün2=r.nextInt(255);
int blau2=r.nextInt(255);
c3= new Color(rot2,grün2,blau2);haus2=true;k2=k2+1;}
if (640>=i & i>=550){ int rot3=r.nextInt(255);//CopyofGebäude2
int grün3=r.nextInt(255);
int blau3=r.nextInt(255);
c1= new Color(rot3,grün3,blau3);haus5=true;k5=k5+1;}
if (850>=i & i>=730){ int rot4=r.nextInt(255);//CopyofGebäude4
int grün4=r.nextInt(255);
int blau4=r.nextInt(255);
c4= new Color(rot4,grün4,blau4);haus1=true;k1=k1+1;if(k1==10){k1=0;}
}}}
catch (AWTException e) {
e.printStackTrace();
}
}
if(a>470) {a=0; v=false;}
}