Ver Mensaje Individual
  #1  
Antiguo 28-10-2016
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola Snaked.

A ver... fijate si esta idea te puede servir aunque sea como puntapié inicial.
Código PHP:
//...
const int MAX_X 1366;

class 
Ship {
private:
  
TPoint _route[MAX_X];
  
TPoint _start;
  
TPoint _stop;
  
int _toproute;
  
int calcRoute();
  const 
TPoint &getPt(const int &ix) { return _route[ix]; }
public:
  
Ship( const TPointstart, const TPointstop);
  
__property int topRoute = { read _toproute };
  
__property TPoint route[int] = { read getPt };
};

Ship::Ship( const TPointstart, const TPointstop) {
  
_start start;
  
_stop  stop;
  
_toproute  calcRoute();
}

int Ship::calcRoute()
{
  
int dx _stop._start.x;
  
int dy _stop._start.y;
  
int cx;

  for(
c=0_start.x_stop.xc++, x++ ) {
    
int y _start.dy * ( _start.) / dx;
    
_route[c]._start.x;
    
_route[c].y;
  }
  return 
c;
}

Ship ship1 Ship(Point(  10100 ), Point240200 ));
Ship ship2 Ship(Point(  50,  50 ), Point150300 ));
Ship ship3 Ship(Point(  8090 ), Point(  220100 ));
int c1c2c3;

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
Image1->Visible  false;
  
Image2->Visible  false;
  
Image3->Visible  false;
  
Timer1->Interval 15;
  
Timer2->Interval 15;
  
Timer3->Interval 15;
  
Timer1->Enabled  false;
  
Timer2->Enabled  false;
  
Timer3->Enabled  false;
}

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  
Image1->Visible c1 ship1.topRoute;
  
Timer1->Enabled Image1->Visible;
  if (
Image1->Visible) {
    
Image1->Left ship1.route[c1].x;
    
Image1->Top  ship1.route[c1].y;
  }
  ++
c1;
}

void __fastcall TForm1::Timer2Timer(TObject *Sender)
{
  
Image2->Visible c2 ship2.topRoute;
  
Timer2->Enabled Image2->Visible;
  if (
Image2->Visible) {
    
Image2->Left ship2.route[c2].x;
    
Image2->Top  ship2.route[c2].y;
  }
  ++
c2;
}

void __fastcall TForm1::Timer3Timer(TObject *Sender)
{
  
Image3->Visible c3 ship3.topRoute;
  
Timer3->Enabled Image3->Visible;
  if (
Image3->Visible) {
    
Image3->Left ship3.route[c3].x;
    
Image3->Top  ship3.route[c3].y;
  }
  ++
c3;
}

void __fastcall TForm1::btnStartClick(TObject *Sender)
{
  
c1 c2 c3 0;
  
Timer1->Enabled true;
  
Timer2->Enabled true;
  
Timer3->Enabled true;
}

//... 
Efecto:



Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita