Pascal/Turbo Pascal - Paleta en pascal. Libreria CRT URGENTE

 
Vista:
sin imagen de perfil

Paleta en pascal. Libreria CRT URGENTE

Publicado por Esteban (12 intervenciones) el 04/11/2013 04:38:32
HOLA HICE UN CODIGO DE UNA PALETA ES PARA UN JUEGO, PERO SOLO ANDA EN LA LIBRERIA CRT, CUANDO LA PONGO EN LA GRAPH NO ANDA... ME PODRIAN AYUDAR...


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
program prueba;
uses crt;
var
   mov:char;
   x,y:word;
 
begin
x:=40;
y:=20;
repeat
gotoxy(x,y);
write('______');
mov:=readkey;
if (x>0) and (x<74) then
  if (mov='M') then
		x:=x+1;
		gotoxy(x,y);
		write('______');
		clrscr;
IF (X>1)
then
if (mov='K')
	then
		x:=x-1;
		gotoxy(x,y);
		write('______');
		clrscr;
until(mov='s');
end.

LA QUIERO PONER EN UNA LIBRERIA GRAPH POR QUE ES PARA HACER UN JUEGO Y CREO QUE ES MAS COMBENIENTE. EL JUEGO ES EL ARKANOID
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Paleta en pascal. Libreria CRT URGENTE

Publicado por ramon (2158 intervenciones) el 04/11/2013 13:00:55
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
38
39
40
41
42
43
{El gotoxy no funciona en modo grafico pero si en modo texto mira esto}
 
 program linea;
 uses
    crt, graph;
  var
    drive, modo : integer;
    move : char;
    x, y : integer;
 
  begin
      drive := detect;
      initgraph(drive, modo,'c:\tp\bgi');
      if graphresult <> 0 then
      halt(1)
   else
      begin
         x := 10;  {posicion de la linea en x}
         y := getmaxy - 20; {posicion de la linea en y}
         setcolor(15);
         line(x,y,x + 10,y); {dibujamos linea}
     repeat
        move := readkey;
        setcolor(0);       {borramos linea}
        line(x,y,x + 10,y);
      if move = #75 then
      begin
          x := x - 10; {para mas rapido incrementa y decrementa x en o mas: 10}
          if x < 10 then
          x := 10;
      end;
      if move = #77 then
      begin
          x := x + 10;
          if x > getmaxx - 15 then
          x := getmaxx - 15;
      end;
         setcolor(15);    {dibujamos en nueva posicion}
         line(x,y,x + 10,y);
     until move = #27;  {tecla [esc] termina}
     closegraph;
    end;
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar