Skip to content

Instantly share code, notes, and snippets.

@tsondt
Created January 2, 2019 21:06
Show Gist options
  • Save tsondt/10136ed2c92bbc185793b8052e2a551c to your computer and use it in GitHub Desktop.
Save tsondt/10136ed2c92bbc185793b8052e2a551c to your computer and use it in GitHub Desktop.
{-------- ROBOX Ver 1.5 ---------}
{-- Written by Dinh Tran Thai Son and Nguyen Tan Thai Hung --}
program Robox;
uses crt;
var i,j,left1,left2,up1,up2,menu,c,l:byte;
keypress:char;
b:array [1..23,1..15] of byte;
die1,die2,quit:boolean;
name1,name2:string;
const
a:array [1..23,1..15] of byte =
((0,0,0,0,0,0,4,0,4,0,0,0,0,0,0),
(0,0,0,0,4,0,1,1,1,0,4,0,0,0,0),
(0,0,0,0,1,1,1,7,1,1,1,0,0,0,0),
(0,0,0,1,1,1,1,1,1,1,1,1,0,0,0),
(0,0,0,0,1,1,0,3,0,1,1,0,0,0,0),
(0,0,0,0,2,0,0,0,0,0,2,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,0,0,2,0,0,0,0,0,2,0,0,0,0),
(0,0,0,0,1,1,0,3,0,1,1,0,0,0,0),
(0,0,0,1,1,1,1,1,1,1,1,1,0,0,0),
(0,0,0,0,1,1,1,8,1,1,1,0,0,0,0),
(0,0,0,0,4,0,1,1,1,0,4,0,0,0,0),
(0,0,0,0,0,0,4,0,4,0,0,0,0,0,0));
pixel='██';
{--* Sound *--}
procedure playsound(up,long:integer);
begin
sound(up);
delay(long);
nosound;
end;
procedure Soundgame;
begin
playsound(100,50);
playsound(200,50);
playsound(300,50);
playsound(400,50);
playsound(500,50);
playsound(600,50);
playsound(700,50);
playsound(800,50);
playsound(900,50);
playsound(1000,50);
end;
procedure Music;
begin
playsound(658,400);nosound;delay(20);
playsound(658,400);nosound;delay(20);
playsound(658,400);
delay(200);
playsound(523,200);
playsound(587,200);nosound;delay(10);
playsound(587,200);
playsound(698,200);
playsound(587,200);
playsound(658,400);
delay(400);
playsound(658,400);nosound;delay(20);
playsound(658,400);nosound;delay(20);
playsound(658,400);
delay(200);
playsound(494,200);nosound;delay(10);
playsound(494,200);nosound;delay(10);
playsound(494,200);
playsound(587,200);
playsound(494,100);nosound;delay(5);
playsound(523,100);
playsound(523,100);nosound;delay(5);
playsound(494,100);
playsound(440,200);
delay(400);
playsound(658,400);nosound;delay(20);
playsound(658,400);nosound;delay(20);
playsound(658,400);
delay(200);
playsound(523,200);
playsound(587,200);nosound;delay(10);
playsound(587,200);
playsound(698,200);
playsound(587,200);
playsound(658,400);
delay(400);
playsound(658,400);nosound;delay(20);
playsound(658,400);nosound;delay(20);
playsound(658,400);
delay(200);
playsound(494,200);nosound;delay(10);
playsound(494,200);nosound;delay(10);
playsound(494,200);
playsound(587,200);
playsound(494,100);nosound;delay(5);
playsound(523,100);
playsound(523,100);nosound;delay(5);
playsound(494,100);
playsound(440,200);
delay(400);
end;
{--* Introduction *--}
procedure Introgamename;
procedure Displaymap;
const
gseg:word=$a000;
spd=4;
size=3;
curve=125;
xmax=240 div size;
ymax=150 div size;
sofs=30;
samp=3;
slen=254;
star:array[1..15,1..59] of byte =
((0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1),
(0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0),
(0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0),
(0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0),
(0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0),
(0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0),
(0,0,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0),
(0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0),
(0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0),
(0,0,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0),
(0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0),
(0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0),
(0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0),
(0,0,1,1,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0),
(0,0,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1));
var stab:array[0..slen] of word;
postab:array[0..xmax,0..ymax] of word;
bitmap:array[0..xmax,0..ymax] of byte;
x,y,i,xp,yp,sidx:word;
tam:longint;
begin
for x:=0 to slen do stab[x]:=round(sin(x*4*pi/slen)*samp)+sofs;
for x:=0 to xmax do
for y:=0 to ymax do bitmap[x,y]:=black;
for y:=1 to 15 do
for x:=1 to 61 do
if star[y,x]<>0 then bitmap[x+10,y+12]:=White;
sidx:=0;
tam:=tam+1;
repeat
for x:=0 to xmax do
for y:=ymax downto 0 do
begin
mem[gseg:postab[x,y]]:=0;
xp:=size*x+stab[(sidx+curve*x+curve*y) mod slen];
yp:=size*y+stab[(sidx+4*x+curve*y+y) mod slen];
postab[x,y]:=xp+yp*320;
mem[gseg:postab[x,y]] :=bitmap[x,y];
end;
sidx:=(sidx+spd) mod slen;
until keypressed;
end;
begin
asm mov ax, 13h; int 10h; end;
displaymap;
textmode(lastmode);
textbackground(0);
clrscr;
soundgame;
keypress:=readkey;
end;
procedure Intro;
var check:boolean;
begin
clrscr;
textcolor(15);
for i:=1 to 32 do
begin
gotoxy(40-i,10);
write('╔');
for j:=1 to i*2-1 do write('═');
write('╗');
for j:=11 to 14 do
begin
gotoxy(40-i,j);
write('║');
write(#32:i*2-1);
write('║');
end;
gotoxy(40-i,14);
write('╚');
for j:=1 to i*2-1 do write('═');
write('╝');
sound(250);
delay(20);
nosound;
delay(50);
end;
for i:=1 to 33 do
begin
gotoxy(i+23,11);
case i of
1:write('W');
2:write('e');
3:write('l');
4:write('c');
5:write('o');
6:write('m');
7:write('e');
8:write(' ');
9:write('t');
10:write('o');
11:write(' ');
12:write('R');
13:write('O');
14:write('B');
15:write('O');
16:write('X');
17:write(' ');
18:write('P');
19:write('r');
20:write('o');
21:write('g');
22:write('r');
23:write('a');
24:write('m');
25:write(' ');
26:write('V');
27:write('e');
28:write('r');
29:write('.');
30:write(' ');
31:write('1');
32:write('.');
33:write('5');
end;
sound(500);
delay(20);
nosound;
delay(50);
end;
for i:=1 to 54 do
begin
gotoxy(i+12,12);
case i of
1:write('W');
2:write('r');
3:write('i');
4:write('t');
5:write('t');
6:write('e');
7:write('n');
8:write(' ');
9:write('b');
10:write('y');
11:write(' ');
12:write('D');
13:write('i');
14:write('n');
15:write('h');
16:write(' ');
17:write('T');
18:write('r');
19:write('a');
20:write('n');
21:write(' ');
22:write('T');
23:write('h');
24:write('a');
25:write('i');
26:write(' ');
27:write('S');
28:write('o');
29:write('n');
30:write(' ');
31:write('a');
32:write('n');
33:write('d');
34:write(' ');
35:write('N');
36:write('g');
37:write('u');
38:write('y');
39:write('e');
40:write('n');
41:write(' ');
42:write('T');
43:write('a');
44:write('n');
45:write(' ');
46:write('T');
47:write('h');
48:write('a');
49:write('i');
50:write(' ');
51:write('H');
52:write('u');
53:write('n');
54:write('g');
end;
sound(500);
delay(20);
nosound;
delay(50);
end;
for i:=1 to 40 do
begin
gotoxy(i+19,13);
case i of
1:write('T');
2:write('h');
3:write('i');
4:write('s');
5:write(' ');
6:write('i');
7:write('s');
8:write(' ');
9:write('a');
10:write(' ');
11:write('f');
12:write('u');
13:write('l');
14:write('l');
15:write('y');
16:write(' ');
17:write('u');
18:write('p');
19:write('d');
20:write('a');
21:write('t');
22:write('e');
23:write('d');
24:write(' ');
25:write('v');
26:write('e');
27:write('r');
28:write('s');
29:write('i');
30:write('o');
31:write('n');
32:write(' ');
33:write('o');
34:write('f');
35:write(' ');
36:write('R');
37:write('O');
38:write('B');
39:write('O');
40:write('X');
end;
sound(500);
delay(20);
nosound;
delay(50);
end;
check:=true;
repeat
if check then textcolor(15) else textcolor(0);
gotoxy(24,11);
write('Welcome to ROBOX Program Ver. 1.5');
gotoxy(13,12);
write('Written by Dinh Tran Thai Son and Nguyen Tan Thai Hung');
gotoxy(20,13);
write('This is a fully updated version of ROBOX');
delay(250);
check:=not(check);
until keypressed;
soundgame;
end;
procedure Introduction_screen;
begin
textcolor(15);
textbackground(0);
clrscr;
write('╔');
for i:=1 to 78 do write('═');
write('╗');
for i:=1 to 3 do
begin
gotoxy(1,i+1);
write('║');
gotoxy(80,i+1);
write('║');
end;
write('╚');
for i:=1 to 78 do write('═');
write('╝');
gotoxy(38,2);
write('ROBOX');
gotoxy(37,3);
write('Ver. 1.5');
gotoxy(14,4);
write('Written by Dinh Tran Thai Son and Nguyen Tan Thai Hung');
gotoxy(35,7);
writeln('╔═════════════╗');
gotoxy(35,8);
writeln('║ MAIN MENU ║');
gotoxy(35,9);
writeln('╚═════════════╝');
gotoxy(35,10);
write('Start New Game');
gotoxy(35,11);
write('Continue Game');
gotoxy(35,12);
write('Change Player 1 ''s Name');
gotoxy(35,13);
write('Change Player 2 ''s Name');
gotoxy(35,14);
write('Help');
gotoxy(35,15);
write('Exit');
end;
{--* Interface *--}
procedure Draw_board;
begin
textcolor(15);
textbackground(0);
clrscr;
gotoxy(5,1);
for i:=1 to 17 do write(pixel);
for i:=1 to 23 do
begin
gotoxy(5,i+1);
writeln(pixel);
gotoxy(37,i+1);
writeln(pixel);
end;
gotoxy(5,25);
for i:=1 to 17 do write(pixel);
gotoxy(50,1);
write('Press F1 for Help');
gotoxy(44,25);
write('Press Esc to return to Main Menu');
gotoxy(43,11);
writeln('╔═══════════════════════════════╗');
gotoxy(43,12);
writeln('║ ROBOX Program ║');
gotoxy(43,13);
writeln('║ Ver 1.5 ║');
gotoxy(43,14);
writeln('║ Written by Dinh Tran Thai Son ║');
gotoxy(43,15);
writeln('╚═══════════════════════════════╝');
gotoxy(54,5);
write('Player 1');
gotoxy(54,20);
write('Player 2');
gotoxy(57-length(name1) div 2,6);
write(name1);
gotoxy(57-length(name2) div 2,21);
write(name2);
end;
procedure Draw_array;
begin
for i:=1 to 23 do
for j:=1 to 15 do
begin
gotoxy(j*2+5,i+1);
case a[i,j] of
0:textcolor(0);
1:textcolor(9);
2:textcolor(3);
3:textcolor(10);
4:textcolor(14);
5:textcolor(12);
7:textcolor(0);
8:textcolor(15);
end;
write(pixel);
end;
gotoxy(80,25);
end;
procedure New_array;
begin
for i:=1 to 23 do
for j:=1 to 15 do a[i,j]:=b[i,j];
end;
{--* Move *--}
procedure Moveleft(var left,up:byte;person:byte);
begin
if left>1 then
begin
for i:=up to up+5 do
for j:=left-1 to left+8 do a[i,j]:=a[i,j+1];
for i:=up to up+5 do a[i,left+8]:=0;
left:=left-1;
if person=1 then
begin
for i:=left1+2 to left1+6 do a[up1+5,i]:=0;
a[up1+4,left1+3]:=0;
a[up1+4,left1+5]:=0;
end;
if person=2 then
begin
for i:=left2+2 to left2+6 do a[up2,i]:=0;
a[up2+1,left2+3]:=0;
a[up2+1,left2+5]:=0;
end;
end;
end;
procedure Moveright(var left,up:byte;person:byte);
begin
if left<7 then
begin
for i:=up to up+5 do
for j:=left+9 downto left+1 do a[i,j]:=a[i,j-1];
for i:=up to up+5 do a[i,left]:=0;
left:=left+1;
if person=1 then
begin
for i:=left1+2 to left1+6 do a[up1+5,i]:=0;
a[up1+4,left1+3]:=0;
a[up1+4,left1+5]:=0;
end;
if person=2 then
begin
for i:=left2+2 to left2+6 do a[up2,i]:=0;
a[up2+1,left2+3]:=0;
a[up2+1,left2+5]:=0;
end;
end;
end;
procedure Movedown(var left,up:byte);
var check:boolean;
begin
check:=true;
for i:=left to left+8 do if (a[up+6,i]<>0) then check:=false;
if check and (up>0) and (up+6<24) then
begin
for i:=up+6 downto up+1 do
for j:=left to left+8 do a[i,j]:=a[i-1,j];
for i:=left to left+8 do a[up,i]:=0;
up:=up+1;
end;
end;
procedure Moveup(var left,up:byte);
var check:boolean;
begin
check:=true;
for i:=left to left+8 do if (a[up-1,i]<>0) then check:=false;
if check and (up<19) and (up-1>0) then
begin
for i:=up-1 to up+4 do
for j:=left to left+8 do a[i,j]:=a[i+1,j];
for i:=left to left+8 do a[up+5,i]:=0;
up:=up-1;
end;
end;
{--* Attack *--}
procedure attack(who,gun:byte);
var i,j,k:byte;
keypress:char;
check:boolean;
begin
check:=true;
case who of
1:begin
if gun=1 then j:=left1+7 else j:=left1+1;
i:=up1+6;
while ((a[i,j]=0)or(a[i,j]=6)) and (i<24) and (i>0) do
begin
a[i,j]:=2;
i:=i+1;
draw_array;
sound(500);
delay(5);
if keypressed then
begin
keypress:=readkey;
case keypress of
'f':moveleft(left2,up2,2);
'h':moveright(left2,up2,2);
'g':movedown(left2,up2);
't':moveup(left2,up2);
end;
check:=false;
end;
end;
if a[i,j] in [3,4,5] then a[i,j]:=a[i,j]+1;
if a[i,j] = 6 then die2:=true;
sound(100);
delay(50);
nosound;
for k:=i-1 downto up1+6 do
begin
a[k,j]:=0;
if check then draw_array;
delay(5);
end;
end;
2:begin
if gun=1 then j:=left2+7 else j:=left2+1;
i:=up2-1;
while ((a[i,j]=0)or(a[i,j]=6)) and (i<24) and (i>0) do
begin
a[i,j]:=2;
if (gun=1) or (gun=2) then i:=i-1 else i:=i+1;
draw_array;
sound(500);
delay(5);
if keypressed then
begin
keypress:=readkey;
case keypress of
'4':moveleft(left1,up1,1);
'6':moveright(left1,up1,1);
'5':movedown(left1,up1);
'8':moveup(left1,up1);
end;
check:=false;
end;
end;
if a[i,j] in [3,4,5] then a[i,j]:=a[i,j]+1;
if a[i,j] = 6 then die1:=true;
sound(100);
delay(50);
nosound;
for k:=i+1 to up2-1 do
begin
a[k,j]:=0;
if check then draw_array;
delay(5);
end;
end;
end;
end;
{--* Die - End Game *--}
procedure End_game;
begin
textcolor(15);
textbackground(0);
clrscr;
soundgame;
if die2=true then
begin
gotoxy(40-(20+length(name1)) div 2,8);
write('Congratulations to ',name1,'!');
end;
if die1=true then
begin
gotoxy(40-(20+length(name2)) div 2,8);
write('Congratulations to ',name2,'!');
end;
gotoxy(7,10);
write('██ ██ ▄██████▄ ██ ██ ██ ▄ ██ ██ ████▄ ██ ██');
gotoxy(7,11);
write('▀██▄▄██▀ ██▀ ▀██ ██ ██ ██ ▄███▄ ██ ██ ██▀██▄ ██ ██');
gotoxy(7,12);
write(' ▀██▀ ██▄ ▄██ ██▄ ▄██ ██▄██ ██▄██ ██ ██ ▀██▄██ ');
gotoxy(7,13);
write(' ██ ▀██████▀ ▀██████▀ ▀███▀ ▀███▀ ██ ██ ▀████ ██');
left1:=4;
up1:=1;
left2:=4;
up2:=18;
die1:=false;
die2:=false;
new_array;
music;
end;
{--* Help *--}
procedure Help;
begin
clrscr;
textcolor(15);
gotoxy(27,1); write('╔═══════════════════════════╗');
gotoxy(27,2); write('║ HELP FOR ROBOX Ver. 1.5 ║');
gotoxy(27,3); writeln('╚═══════════════════════════╝');
writeln('Welcome to ROBOX Program Ver 1.5. This is a fully updated version of ROBOX');
gotoxy(26,6); write(' KEY CONTROL ');
gotoxy(15,8); write('Player 1');
gotoxy(12,9); write('Up : Key T');
gotoxy(12,10); write('Down : Key G');
gotoxy(12,11); write('Left : Key F');
gotoxy(12,12); write('Right : Key H');
gotoxy(12,13); write('Gun 1 : Key S');
gotoxy(12,14); write('Gun 2 : Key A');
gotoxy(57,8); write('Player 2');
gotoxy(54,9); write('Up : Key 8');
gotoxy(54,10); write('Down : Key 5');
gotoxy(54,11); write('Left : Key 4');
gotoxy(54,12); write('Right : Key 6');
gotoxy(54,13); write('Gun 1 : Key ]');
gotoxy(54,14); write('Gun 2 : Key [');
for i:=8 to 14 do
begin
gotoxy(40,i);
writeln('║');
end;
gotoxy(35,17); writeln('GAMES QUEST');
gotoxy(6,18);
write('You must hit tree times to break the green box on top of the robot.');
gotoxy(35,20); write('GOOD LUCK !');
gotoxy(25,25); write('Press Esc to return to Main Menu');
end;
{--* Change Name *--}
procedure Changename(player:byte);
begin
clrscr;
gotoxy(25,12);
write('Player ',player,' ''s name : ');
if player=1 then readln(name1) else readln(name2);
end;
{--* Main Program *--}
begin
textcolor(15);
textbackground(0);
clrscr;
for i:=1 to 23 do
for j:=1 to 15 do b[i,j]:=a[i,j];
left1:=4;
up1:=1;
left2:=4;
up2:=18;
die1:=false;
die2:=false;
name1:='Son';
name2:='Hung';
introgamename;
intro;
menu:=1;
c:=33;
l:=10;
repeat
introduction_screen;
gotoxy(c,l);
write('');
gotoxy(c,l);
keypress:=readkey;
case keypress of
#0:begin
gotoxy(c,l);
write(#127);
keypress:=readkey;
case keypress of
#72:if l>10 then
begin
l:=l-1;
menu:=menu-1;
end
else
if l=10 then
begin
menu:=6;
l:=15;
end;
#80:if l<15 then
begin
l:=l+1;
menu:=menu+1;
end
else
if l=15 then
begin
menu:=1;
l:=10;
end;
end;
end;
#13:begin
case menu of
1,2:begin
soundgame;
draw_board;
if menu=1 then
begin
new_array;
left1:=4;
up1:=1;
left2:=4;
up2:=18;
end;
draw_array;
repeat
gotoxy(80,25);
keypress:=readkey;
case keypress of
#27:introduction_screen;
'4':moveleft(left1,up1,1);
'6':moveright(left1,up1,1);
'5':movedown(left1,up1);
'8':moveup(left1,up1);
']':attack(1,1);
'[':attack(1,2);
'f':moveleft(left2,up2,2);
'h':moveright(left2,up2,2);
'g':movedown(left2,up2);
't':moveup(left2,up2);
's':attack(2,1);
'a':attack(2,2);
#0:begin
keypress:=readkey;
if keypress=#59 then
repeat
help;
keypress:=readkey;
if keypress=#27 then introduction_screen;
until keypress=#27;
end;
end;
if (die1=true)or(die2=true) then
begin
end_game;
keypress:=#27;
end
else draw_array;
until (keypress=#27);
end;
3:begin
soundgame;
changename(1);
introduction_screen;
end;
4:begin
soundgame;
changename(2);
introduction_screen;
end;
5:begin
soundgame;
repeat
help;
keypress:=readkey;
if keypress=#27 then introduction_screen;
until keypress=#27;
end;
6:begin
quit:=true;
end;
end;
end;
end;
until quit;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment