C/C++ Graphic in motion

Pages: 12
Thank you andrei c. I guess things r different here in Ploiesti.

Does anyone know how to switch this lines to an extract function ?
(I don't know if i asked right)
Meaning, this coordonates needs to be in a text(*.txt) file and inside this lines needs to be the function that does that.

line(60+i,y-25,30+i,y-45+j);
line(30+i,y-45+j,100+i,y-25);
line(60+i,y+25,30+i,y+45+q);
line(30+i,y+45+q,100+i,y+25);


Thank you.
Do you mean to extract that exact text??Or to make 4 lines???The code above seems to make some kind of rectangle.It's that what you want??And what library are you using for GUI??
Be more specific.
The program is done. Its a little bit different from what i wanted but eveything went allright in class.

Thank you.

I like to share, so here it is. Plane.cpp + valori.txt (For some extracted values)

Plane.cpp :

#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include <fstream.h>

void main()
{
int gdriver = DETECT, gmode;
int a,b,c,d,e,f;
ifstream f1("valori.txt");
f1>>a;
f1>>b;
f1>>c;
f1>>d;
f1>>e;
f1>>f;
initgraph(&gdriver, &gmode, "C:\\borlandc\\bgi\\");
delay(a);
setcolor(b);
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\tAvion cu motor ia-ma si pe mine-n zbor ";
delay(c);
for(int i=-200;i<400;i++)
{ setcolor(d);
line(210+i,220,210+i,260);
line(210+i,260,220+i,250);
line(210+i,220,220+i,230);
line(210+i,250,280+i,250);
line(210+i,230,280+i,230);
line(280+i,250,290+i,240);
line(280+i,230,290+i,240);
line(240+i,250,240+i,280);
line(240+i,200,240+i,230);
line(240+i,280,270+i,250);
line(240+i,200,270+i,230);
delay(e);
setcolor(f);
line(210+i,220,210+i,260);
line(210+i,260,220+i,250);
line(210+i,220,220+i,230);
line(210+i,250,280+i,250);
line(210+i,230,280+i,230);
line(280+i,250,290+i,240);
line(280+i,230,290+i,240);
line(240+i,250,240+i,280);
line(240+i,200,240+i,230);
line(240+i,280,270+i,250);
line(240+i,200,270+i,230);
}
closegraph();
f1.close();
getch();
}


valori.txt :

2000 1 2 2 10 0
Topic archived. No new replies allowed.
Pages: 12