Разработка компьютерной игры "Змейка"

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

>For Y1:=4 to 22 do

begin

GotoXY (25,Y1);

Write (*);

GotoXY (55,Y1);

Write (*);

end;

K:=0;

Repeat

k:=k+kk;

kk:=0;

If k=0 Then Ramka (30,6, ИГРАТЬ ,128) else

Ramka (30,6, ИГРАТЬ ,15);

If k=1 Then Ramka (30,10, РЕКОРДЫ ,128) else

Ramka (30,10, РЕКОРДЫ ,15);

If k=2 then Ramka (30,14, СПРАВКА ,128) else

Ramka (30,14, СПРАВКА ,15);

If k=3 then Ramka (30,18, ВЫХОД ,128) else

Ramka (30,18, ВЫХОД ,15);

Kno:=ReadKey;

If Kno=#80 then Begin if k<3 then kk:=1 else kk:=0; end else

if Kno=#72 then Begin if k>0 then kk:=-1 else kk:=0; end;

until Kno=chr(13);

If k=1 then

begin

Clrscr;

GotoXy(36,5);

writeln(РЕКОРДЫ);

reset (f3);

for i:=1 to 10 do

begin

readln(f3,resul);

GotoXY (32,7+i);

Write(resul);

end;

close(f3);

Readln;

end;

If k=2 then

repeat

spravka;

until k2=2;

If k=3 then

exit;

until (k=3) or (k=0);

If k=0 then begin

menu2 ( УРОВЕНЬ СЛОЖНОСТИ, ГЛИСТ , ЗМЕЯ , АНАКОНДА );

end;

If K2=0 then begin Sl:=40000; och:=25; d:=5 end else if k2=1 then begin

Sl:=30000; och:=50; d:=10 end else begin Sl:=20000; och:=100; d:=15 end;

TextBackground (1);

Textcolor (5);

clrscr;

schot:=0; playE:=1;

Xz[1]:=30;

Yz[1]:=13;

For i:=2 to 40 do

begin

Xz[i]:=Xz[1];

Yz[i]:=Yz[1];

end;

For X1:=3 to 57 do

Begin

GotoXY (x1,2);

Write (*);

GotoXY (X1,23);

write (*);

end;

For Y1:=2 to 23 do

Begin

GotoXY (3,Y1);

Write (*);

GotoXY (57,y1);

Write (*);

end;

Play:=1;

GotoXY(60,4);

write(СЧЕТ: );

GotoXY(60,6);

write(Рост змеи: );

gotoXY(60,8);

write(Лучшие результаты:);

reset(f3);

for i:=1 to 3 do

begin

readln(f3,resul);

GotoXY (60,9+i);

Write(resul);

end;

close(f3);

Repeat

If play=1 then begin

TextColor (4);

Ax:=xz[1]; Ay:=Yz[1];

Xz[1]:=Xz[1]+H; Yz[1]:=Yz[1]+W;

Bx:=Xz[2]; By:=Yz[2];

Xz[2]:=Ax; Yz[2]:=Ay;

For i:=3 to 40 do

izm(i);

GotoXY (Xz[1],Yz[1]);

write(chr(1));

For i:=2 to d do

begin

GotoXY (Xz[i],Yz[i]);

Write(chr(4));

end;

Delay(SL);

Textcolor (1);

GotoXY (Xz[1],Yz[1]);

write(chr(1));

For i:=2 to 40 do

begin

GotoXY (Xz[i],Yz[i]);

Write(chr(4));

end;

randomize;

if PlayE=1 then

begin

Ex:=Random(54)+4;

Ey:=random(18)+4;

If (K2=0) and (schot<>0) and ((schot mod 75)=0) then

d:=d+1;

if (k2=0) and (schot<>0) and ((schot mod 150)=0) then

Sl:=Sl-500;

If (K2=1) and (schot<>0) and ((schot mod 150)=0) then

d:=d+1;

if (k2=1) and (schot<>0) and ((schot mod 500)=0) then

Sl:=Sl-500;

If (K2=2) and (schot<>0) and ((schot mod 500)=0) then

d:=d+1;

if (k2=2) and (schot<>0) and ((schot mod 1000)=0) then

Sl:=Sl-500;

PlayE:=0; end;

Textcolor (6);

GotoXY(Ex,Ey);

write(chr(6));

if (Xz[1]=Ex) and (Yz[1]=Ey) then

begin

schot:=schot+och;

PlayE:=1;

Textcolor (1);

GotoXy(Ex,Ey);

write ( );

end;

Case Kno of

#72: Begin W:=-1; H:=0; end;

#80: Begin W:=1; H:=0; end;

#77: Begin W:=0; H:=1; end;

#75: Begin W:=0; h:=-1; end;

end;

If Keypressed=true then begin onk:=readkey;Kno:=Readkey; end;

end;

GotoXY(66,4);

write(Schot);

GotoXY(70,6);

write(d);

sa:=10;

stolknovenie;

until Play=0;

If play=0 then begin

TextBackground (0);

Textcolor (15);

clrscr;

GotoXY(6,8);

write( ***** ***** * * ******* ***** ** ** ******* ****** );

GotoXY(6,9);

write(******* ******* ** ** ******* ******* ** ** ******* *******);

GotoXY(6,10);

write(** ** ** *** *** ** ** ** ** ** ** ** **);

GotoXY(6,11);

write(** ** ** **** **** ** ** ** ** ** ** ** **);

GotoXY(6,12);

write(** ** ** ** *** ** **** ** ** ** ** **** ** **);

GotoXY(6,13);

write(** ** ******* ** * ** **** ** ** ** ** **** ****** );

GotoXY(6,14);

write(** *** ******* ** ** ** ** ** ** ** ** **** );

GotoXY(6,15);

write(** ** ** ** ** ** ** ** ** ** ** ** ** ** );

GotoXY(6,16);

write(******* ** ** ** ** ******* ******* *** ******* ** ** );

GotoXY(6,17);

write( ***** ** ** ** ** ******* ***** * ******* ** **);

GotoXY(25,23);

Write(Для продолжения нажмите ENTER);

repeat

kno:=readkey;

until Kno=chr(13);

end;

resultat;

H:=0; w:=0; k:=0; kk:=0;

until k=3; end.

Размещено на A