Ver Mensaje Individual
  #6  
Antiguo 27-10-2016
Snaked Snaked is offline
Baneado
NULL
 
Registrado: sep 2016
Posts: 102
Reputación: 0
Snaked Va por buen camino
Ecfisa: ya lo he solucionado.... he adaptado tu funcion al TTimer de la siguiente manera

1) declaro como globales las siguientes variables

Código PHP:
TPoint INICIO_NAVE;
TPoint DESTINO_NAVE;
bool STOP_MOVIMIENTO_NAVE false;
int x 0int y 0;
int dx 0;
int dy 0
y luego en el TTimer tengo puesto esto

Código PHP:
  if(DESTINO_NAVE.x) { x++; INICIO_NAVE.dy * (INICIO_NAVE.x) / dx; }
  else 
STOP_MOVIMIENTO_NAVE true
de forma que cada vez que se produce un tick del timer avanza por la linea

y luego en el dibujado del mapa en pantalla tengo asi

Código PHP:
 void Muestra_Mapa(void)
{

   
SECTOR_VEGA();

   
//Dibuja la nave 1
      
Form1->g2 0;
      
Form1->g2 Form2->Image_explorer1->Picture->Graphic;
      
Form1->tablero->Canvas->Draw(xy,  Form1->g2);

    if(
rejillaMuestra_Rejilla();


 
Form1->tablero->Repaint();
 
Form1->skreen->Picture->Graphic Form1->tablero->Picture->Graphic;
 
Application->ProcessMessages();



y para comenzar el proceso de animacion, esto en un TButton (enviar nave de exploracion)

Código PHP:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 
pos_nave1X 40 Form2->Image2->Picture->Graphic->Width-80;
 
pos_nave1Y 40 Form2->Image2->Picture->Graphic->Height;
 
INICIO_NAVE Point40 Form2->Image2->Picture->Graphic->Width/240 Form2->Image2->Picture->Graphic->Width/2);
 
DESTINO_NAVE Point240410);

  
dx DESTINO_NAVE.INICIO_NAVE.x;
  
dy DESTINO_NAVE.INICIO_NAVE.y;
  
INICIO_NAVE.x;
}
//--------------------------------------------------------------------------- 
Responder Con Cita