Como hago para que no se me logge cuando cambio de posicion el cuadrito!..
Publicado por Esteban (12 intervenciones) el 05/11/2013 16:50:48
Lo que pasa es que cuando entra al if move='M', y incrementa el X. Cuando cambia la posicion tarda. Y se ve muy feo.. ayuda...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
program linea;
uses
wincrt, graph;
var
drive, modo : integer;
x,y:word;
move:char;
begin
drive := detect;
initgraph(drive, modo,'c:\fpc'); {ponlo a tu direccion}
x:=500;
y:=510;
repeat
rectangle(x,500,y,510);
move:=readkey;
if move='M' then
if (x<1010) and (y<1020) then
begin
x:=x+10;
y:=y+10;
rectangle(x,500,y,510);
cleardevice;
end;
if move='K' then
if (x>10) and (y>20) then
begin
x:=x-10;
y:=y-10;
rectangle(x,500,y,510);
cleardevice;
end;
until move='S';
end.
Valora esta pregunta
0