void Pesawat(float x,float y,float s)
{ line(0*s+x,0*s+y,1*s+x,1*s+y);
line(1*s+x,1*s+y,0.5*s+x,4*s+y);
line(0*s+x,4*s+y,0.5*s+x,4*s+y);
line(0*s+x,4*s+y,1*s+x,4*s+y);
line(1*s+x,4*s+y,0*s+x,4.5*s+y);
line(-0*s+x,0*s+y,-1*s+x,1*s+y);
line(-1*s+x,1*s+y,-0.5*s+x,4*s+y);
line(-0*s+x,4*s+y,-0.5*s+x,4*s+y);
line(-0*s+x,4*s+y,-1*s+x,4*s+y);
line(-1*s+x,4*s+y,-0*s+x,4.5*s+y);
}
main()
{ float x1,y1,x2,y2,x,y;
float s;
s=20; x1=100; y1=100; x2=200; y2=100;
initwindow(300,300);//Inisialisasi Layar Grafik
while (!kbhit())
{ cleardevice();
x=mousex();
y=mousey();
Pesawat(x,y,30);
y1=y1-1;
y2=y2-2;
if (y1<0 y1="300;}</p"> if (y2<0 nbsp="" p="" y2="300;"> Pesawat(x1,y1,10);
Pesawat(x2,y2,20);
delay(50);
}
closegraph();//Menutup Grafik
}
No comments:
Post a Comment