bueno pues no soy un experto pero prueba esto y me cuentas en mi correo:::::::::
[email protected]
PUES EL FUNCIONAMIENTO ES UN CUADRO QUE SE MUEVE CON LAS FLECHAS DEL TECLADO PRUEBA MOVERLO PARA ARRIBA, PARA ABAJO, Y PARA LOS LADOS Y ME CUENTAS YO SE QUE VAS A TENER UN MONTON DE DUDAS PERO ESCRIBEMELAS A MI CORREO YA QUE ESTOY TRABAJANDO Y NO ME DIO TIEMPO EXPLICARTELO POR ESCRITO PERO PRUEBALO Y VAS A VER QUE TE VAS A PICAR Y VAS A QUERER APRENDER MAS SOBRE GRAFICOS...........
GRACIAS POR TOMAR EN CUENTA MI PROGRAMA
ESPERO TU RESPUESTA
program grafic;
uses fdelay,crt,graph; {LA UNIDAD GRAPH ES LA QUE TE SIRVE PARA INICIAR GRAFICOS}
var
drv,modo:integer;
cuadro1:pointer;
procedure inicia_graficos;
begin
drv:= 3;
modo:= 2;
initgraph(drv,modo ,'');
end;
procedure cuadro;
begin
cleardevice;
line(250,150,350,150);
line(250,150,250,250);
line(350,150,350,250);
line(250,250,350,250);
getmem(cuadro1,imagesize(225,125,375,275));
getimage(225,125,375,275,cuadro1^);
end;
Procedure desplazamientos;
var
x,y,desplazamiento,valor,pausa:integer;
contador:byte;
tecla:char;
begin
desplazamiento:= 20;
pausa: 100;
x:= getmaxx div 2;
y:= getmaxy div 2;
cleardevice;
repeat
tecla:= readkey;
valor:= ord(tecla);
if valor = 0 then valor:= -ord(readkey);
case valor of
-75:begin
x:= x - desplazamiento;
repeat
putimage(x,y,cuadro1^,xorput);
delay(pausa);
putimage(x,y,cuadro1^,xorput);
until keypressed;
end;
-77:begin
x:= x + desplazamiento;
repeat
putimage(x,y,cuadro1^,xorput);
delay(pausa);
putimage(x,y,cuadro1^,xorput);
until keypressed;
end;
-80:begin
y= y + desplazamiento;
repeat
putimage(x,y,cuadro1^,xorput);
delay(pausa);
putimage(x,y,cuadro1^,xorput);
until keypressed;
end;
-72:begin
y:= y - desplazamiento;
repeat
putimage(x,y,cuadro1^,xorput);
delay(pausa);
putimage(x,y,cuadro1^,xorput);
until keypressed;
end;
else
begin
sound(400);
delay(59);
nosound;
end;
end;
until tecla=#27;
end;
begin
inicia_graficos;
cuadro;
desplazamientos;
readln;
closegraph;
end.