双人炮塔~改版,更牛掰
pascal吧
全部回复
仅看楼主
level 3
解决了打不死的问题
再也不用担心要玩一下午了,哈哈哈!
2018年02月10日 10点02分 1
level 3
三楼发源码
2018年02月10日 10点02分 2
level 3
uses crt;
const cz:array[1..4,1..2] of -1..1=((0,1),(1,0),(0,-1),(-1,0));
var i,j,xz1,attack,life,yz1,y1,xz2,yz2,y2,t1,t2,t3,k,v1,v2,ii,jj,kk:longint;
ch:char;
a:array[1..20] of longint;
s,t,tt:string[4];
procedure priter;
begin
gotoxy(1,1);
textbackground(black);
for i:=1 to 20 do
begin
for j:=1 to 40 do
write(' ');
writeln;
end;
end;
procedure priv;
begin
gotoxy(1,1);
write('v1: ',v1,' v2: ',v2,' ');
end;
procedure start;
begin
priter;
textcolor(red);
textbackground(black);
gotoxy(1,1);
writeln(' | |');
writeln(' | ~{ ~~{ ~~{ ~~ <~>|');
writeln(' |<-> -- }-- }-- } |');
for i:=1 to 17 do
writeln(' | |');
gotoxy(1,5);
write(' | Life : ');
read(life);
if life<=0 then begin halt end;
gotoxy(1,7);
write(' | Attack : ');
read(attack);
if (attack<=0) or (attack>life) then begin halt end;
{readln;
gotoxy(1,7);
write(' | V1 : (****)');
gotoxy(10,7);
read(s);
readln;
gotoxy(1,9);
write(' | V2 : (****)');
gotoxy(10,9);
read(t);}
gotoxy(1,9);
writeln(' | Really? |');
ch:=readkey;
gotoxy(1,11);
for i:=9 downto 1 do
begin
write(' | [(',i,')] |');
sound(1871);
delay(123);
nosound;
delay(200);
for kk:=1 to 40 do
write(#8);
end;
write(' | Go!!! |');
sound(1234);
delay(123);
nosound;
end;
procedure GameOver(p:integer);
begin
if p=1 then begin gotoxy(1,y1);write('<*>');end;
if p=2 then begin gotoxy(38,y2);write('<*>');end;
textcolor(black);
textbackground(red);
gotoxy(10,10);
p:=3-p;
write('Player ',p:1,' is Win!!!');
repeat ch:=readkey;until ord(ch)=13;
textbackground(red);
ClrScr;
halt;
end;
procedure over(p:integer);
begin
if p=1 then begin v1:=v1-attack;gotoxy(1,y1);write('<*>');end;//if y1<>20 then begin gotoxy(1,y1+1);write('*')end else gotoxy(1,y1-1); write('*'); end;
if p=2 then begin v2:=v2-attack;gotoxy(38,y2);write('<*>');end;//if y2<>20 then begin gotoxy(37,y2+1);write(' *')end else gotoxy(38,y2-1);write(' *'); end;
priv;
if v1<=0 then gameover(1);
if v2<=0 then gameover(2);
end;
procedure go;
begin
textbackground(red);
ClrScr;
for i:=1 to 20 do a[i]:=38;
textbackground(black);
textcolor(red);
priter;
gotoxy(1,2);
y1:=1;
write('<->');
gotoxy(38,2);
write('<~>');
gotoxy(1,1);
y1:=2;t1:=0;t2:=0;t3:=0;y2:=2;v1:=life;v2:=life;
priv;
while true do
begin
delay(1);
inc(t1,1);
if t1=1000 then
begin
inc(t2);
if t2=60 then begin t2:=0;inc(t3);end;
end;
if keypressed then
begin
ch:=readkey;
if (ch='w') and (y1>2) then
begin
gotoxy(1,y1);
write(' ');
dec(y1);
gotoxy(1,y1);
write('<->');
end;
if (ch='s') and (y1<20) then
begin
gotoxy(1,y1);
write(' ');
inc(y1);
gotoxy(1,y1);
write('<->');
end;
if (ch='q') then break;
if (ch='f')and(xz1=0) then
begin
xz1:=3;
yz1:=y1;
end;
if (ch='p') and (y2>2) then
begin
gotoxy(38,y2);
write(' ');
dec(y2);
gotoxy(38,y2);
write('<~>');
end;
if (ch=';') and (y2<20) then
begin
gotoxy(38,y2);
write(' ');
inc(y2);
gotoxy(38,y2);
write('<~>');
end;
if (ch='k')and(xz2=0) then
begin
xz2:=37;
yz2:=y2;
end;
end;
//textcolor(white);
if (t1 mod 5=0)and(xz1<>0) then
begin
if xz1>38 then
begin
gotoxy(4,yz1);
write;write;write;
for ii:=1 to 37 do
write(' ');
if yz1=y2 then Over(2);
xz1:=0;
yz1:=0;
end
else
begin
gotoxy(xz1+2,yz1);
write('-- }');
xz1:=xz1+4;
end;
end;
if (t1 mod 5=0)and(xz2<>0) then
begin
if xz2<2 then
begin
gotoxy(38,yz2);
write;write;write;
gotoxy(xz2,yz2);
for jj:=37 downto 1 do
write(' ');
if yz2=y1 then Over(1);
xz2:=0;
yz2:=0;
end
else
begin
gotoxy(xz2-4,yz2);
write('{ ~~');
xz2:=xz2-4;
end;
end;
end;
end;
begin
start;
go;
end.
2018年02月10日 10点02分 3
level 3
格斯乱了,谁能帮我杀了百度
2018年02月10日 10点02分 4
level 3
大家在‘’中打3个空格
2018年02月10日 10点02分 5
1