this slowpoke moves

Draw a House

procedure TForm1.Button1Click(Sender: TObject);
	procedure zeichne_Haus(x,y : integer; a : real);   // Prozedur-Vereinbarung
 	begin
   	with PaintBox1.Canvas do
   	begin
     // Seitenwände und Boden
     moveTo(x,y-round(a*3.5));
     lineTo(x,y);
     lineTo(x+round(4*a),y);
     lineTo(x+round(4*a),y-round(3.5*a));
     // Dach
     moveTo(x-round(a*1),y-round(a*2.5));
     lineTo(x+round(a*2),y-round(a*5.5));
     lineTo(x+round(5*a),y-round(2.5*a));
     // Tür
     moveTo(x+round(a*0.5),y);
     lineTo(x+round(a*0.5),y-round(a*2.5));
     lineTo(x+round(a*1.5),y-round(a*2.5));
     lineTo(x+round(a*1.5),y);
     // großes Fenster
     moveTo(x+round(a*2),y-round(a*1));
     lineTo(x+round(a*3.5),y-round(a*1));
     lineTo(x+round(a*3.5),y-round(a*2.5));
     lineTo(x+round(a*2),y-round(a*2.5));
     lineTo(x+round(a*2),y-round(a*1));
     moveTo(x+round(a*2),y-round(a*1.5));
     lineTo(x+round(a*3.5),y-round(a*1.5));
     moveTo(x+round(a*2),y-round(a*2));
     lineTo(x+round(a*3.5),y-round(a*2));
     moveTo(x+round(a*2.5),y-round(a*2.5));
     lineTo(x+round(a*2.5),y-round(a*1));
     moveTo(x+round(a*3),y-round(a*2.5));
     lineTo(x+round(a*3),y-round(a*1));
     // kleines Fenster
     moveTo(x+round(a*1.5),y-round(a*3.5));
     lineTo(x+round(a*2.5),y-round(a*3.5));
     lineTo(x+round(a*2.5),y-round(a*4.5));
     lineTo(x+round(a*1.5),y-round(a*4.5));
     lineTo(x+round(a*1.5),y-round(a*3.5));
     moveTo(x+round(a*2),y-round(a*4.5));
     lineTo(x+round(a*2),y-round(a*3.5));
     moveTo(x+round(a*1.5),y-round(a*4));
     lineTo(x+round(a*2.5),y-round(a*4));
     // Schornstein
     moveTo(x+round(a*1),y-round(a*4.5));
     lineTo(x+round(a*1),y-round(a*6));
     lineTo(x+round(a*1.5),y-round(a*6));
     lineTo(x+round(a*1.5),y-round(a*5));
   end;
 end;
begin
  zeichne_Haus(300,500,70);   // Prozedur-Aufruf
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate