home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #1
/
Image.iso
/
cdd
/
direkt
/
fingb
/
glueck.lzh
/
SAMMLUNG.ZIP
/
DEMO3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-08-03
|
11KB
|
367 lines
PROGRAM Spiel;
USES CRT, MOUSE, GRAPH, APP, DOS, DRIVERS, OBJECTS;
VAR x, y, x2, y2 : INTEGER;
Ch : CHAR;
Player1, Player2, Frage, Wahl : STRING;
PROCEDURE Anleitung;
begin
gotoxy (35,2);
write ('SPIELREGELN');
gotoxy (35,3);
write ('===========');
gotoxy (15,5);
write ('Dieses Spiel kann nur mit 2 Spielern gespielt werden.');
gotoxy (15,7);
write ('Der Jäger muß versuchen, den Hasen zu schnappen. Der');
gotoxy (15,9);
write ('Hase muß versuchen, so lange wie möglich zu überleben.');
gotoxy (9,11);
write ('TIP : Es kann z.B. einer den Hasen spielen und die Zeit stoppen,');
gotoxy (15,13);
write ('wie lange er überlebt hat und anschließend spielt der andere');
gotoxy (15,15);
write ('den Hasen und versucht, Die Zeit zu überbieten.');
gotoxy (29,20);
write ('Und nun VIEL SPASS !!!');
gotoxy (30,24);
write ('Weiter mit bel. Taste');
Ch := ReadKey;
end;
BEGIN
clrscr;
TextColor (White);
REPEAT
clrscr;
gotoxy (19,13);
write ('(S)piel starten / (R)egeln ? (S/R) : ');
readln(Wahl);
IF ( Wahl = 'r' ) OR ( Wahl = 'R' )
THEN
begin
Anleitung;
end;
UNTIL ( Wahl = 's' ) OR ( Wahl = 'S');
REPEAT
clrscr;
TextColor (White);
gotoxy (25,12);
write ('Name Player 1 : ');
readln(Player1);
clrscr;
gotoxy (25,13);
writeln ('Du bist der Hase ( # ).');
delay (1500);
clrscr;
gotoxy (25,14);
write ('Name Player 2 : ');
readln(Player2);
clrscr;
gotoxy (25,13);
write ('Du bist der Jäger ( o ).');
delay (1500);
clrscr;
gotoxy (25,2);
write ('TASTENKOMBINATIONEN FÜR PLAYER 1');
gotoxy (25,3);
write ('════════════════════════════════');
gotoxy (35,7);
write ('Du bist : ');
TextColor (Yellow);
write ('#');
TextColor (White);
gotoxy (22,9);
write ('Nach Links => " Pfeil nach Links "');
gotoxy (22,11);
write ('Nach Rechts => " Pfeil nach Rechts "');
gotoxy (22,13);
write ('Nach Oben => " Pfeil nach Oben "');
gotoxy (22,15);
write ('Nach Unten => " Pfeil nach Unten "');
gotoxy (30,24);
write ('Weiter mit " RETURN"');
REPEAT
Ch := ReadKey;
UNTIL Ch = #13;
clrscr;
TextColor (White);
gotoxy (25,2);
write ('TASTENKOMBINATIONEN FÜR PLAYER 2');
gotoxy (25,3);
write ('════════════════════════════════');
gotoxy (35,7);
write ('Du bist : ');
TextColor (Yellow);
write ('o');
TextColor (White);
gotoxy (29,9);
write ('Nach Links => " Y "');
gotoxy (29,11);
write ('Nach Rechts => " X "');
gotoxy (29,13);
write ('Nach Oben => " Q "');
gotoxy (29,15);
write ('Nach Unten => " A "');
gotoxy (30,24);
write ('Weiter mit " RETURN"');
REPEAT
Ch := ReadKey;
UNTIL Ch = #13;
DefineTextCursor(hardwaretextcursor,0,0);
clrscr;
TextColor (Red);
FOR x := 1 TO 80 DO
begin
gotoxy (x,1);
write (CHR(219));
end;
FOR y := 1 TO 24 DO
begin
gotoxy (80,y);
write (CHR(219));
end;
FOR x := 79 DOWNTO 1 DO
begin
gotoxy (x,24);
write (CHR(219));
end;
FOR y := 24 DOWNTO 2 DO
begin
gotoxy (1,y);
write (CHR(219));
end;
TextColor (Green);
FOR y := 5 TO 19 DO
begin
gotoxy (16,y);
write (CHR(219));
end;
FOR y := 5 TO 19 DO
begin
gotoxy (64,y);
write (CHR(219));
end;
TextColor (Yellow);
gotoxy (40,22);
write ('#');
gotoxy (40,3);
write ('o');
TextColor (Black);
x := 40;
y := 22;
x2 := 40;
y2 := 3;
REPEAT
Ch := ReadKey;
IF Ch = #72
THEN
begin
x := x;
y := y-1;
gotoxy (x,y);
TextColor (Yellow);
write ('#');
x := x;
y := y+1;
gotoxy (x,y);
TextColor (Black);
write (' ');
x := x;
y := y-1;
end;
IF Ch = #75
THEN
begin
x := x-1;
y := y;
gotoxy (x,y);
TextColor (Yellow);
write ('#');
x := x+1;
y := y;
gotoxy (x,y);
TextColor (Black);
write (' ');
x := x-1;
y := y;
end;
IF Ch = #77
THEN
begin
x := x+1;
y := y;
gotoxy (x,y);
TextColor (Yellow);
write ('#');
x := x-1;
y := y;
gotoxy (x,y);
TextColor (Black);
write (' ');
x := x+1;
y := y;
end;
IF Ch = #80
THEN
begin
x := x;
y := y+1;
gotoxy (x,y);
TextColor (Yellow);
write ('#');
x := x;
y := y-1;
gotoxy (x,y);
TextColor (Black);
write (' ');
x := x;
y := y+1;
end;
IF Ch = #113 THEN
begin
x2 := x2;
y2 := y2-1;
gotoxy (x2,y2);
TextColor (Yellow);
write ('o');
x2 := x2;
y2 := y2+1;
gotoxy (x2,y2);
TextColor (Black);
write (' ');
x2 := x2;
y2 := y2-1;
end;
IF Ch = #121 THEN
begin
x2 := x2-1;
y2 := y2;
gotoxy (x2,y2);
TextColor (Yellow);
write ('o');
x2 := x2+1;
y2 := y2;
gotoxy (x2,y2);
TextColor (Black);
write (' ');
x2 := x2-1;
y2 := y2;
end;
IF Ch = #120 THEN
begin
x2 := x2+1;
y2 := y2;
gotoxy (x2,y2);
TextColor (Yellow);
write ('o');
x2 := x2-1;
y2 := y2;
gotoxy (x2,y2);
TextColor (Black);
write (' ');
x2 := x2+1;
y2 := y2;
end;
IF Ch = #97 THEN
begin
x2 := x2;
y2 := y2+1;
gotoxy (x2,y2);
TextColor (Yellow);
write ('o');
x2 := x2;
y2 := y2-1;
gotoxy (x2,y2);
TextColor (Black);
write (' ');
x2 := x2;
y2 := y2+1;
end;
UNTIL (( x > 0 ) AND ( y = 1 )) OR (( x = 80 ) AND ( y > 0 )) OR
(( x < 81 ) AND ( y = 24 )) OR (( x = 1 ) AND ( y < 24 )) OR
(( x = 16 ) AND ( y > 4 ) AND ( y < 20 )) OR (( x = 64 ) AND
( y > 4 ) AND ( y < 20 )) OR
(( x2 > 0 ) AND ( y2 = 1 )) OR (( x2 = 80 ) AND ( y2 > 0 )) OR
(( x2 < 81 ) AND ( y2 = 25 )) OR (( x2 = 1 ) AND ( y2 < 24 )) OR
(( x2 = 16 ) AND ( y2 > 4 ) AND ( y2 < 20 )) OR (( x2 = 64 ) AND
( y2 > 4 ) AND ( y2 < 20 )) OR (( x = x2 ) AND ( y = y2 ));
IF (( x > 0 ) AND ( y = 1 )) OR (( x = 80 ) AND ( y > 0 )) OR
(( x < 81 ) AND ( y = 24 )) OR (( x = 1 ) AND ( y < 24 )) OR
(( x = 16 ) AND ( y > 4 ) AND ( y < 20 )) OR (( x = 64 ) AND
( y > 4 ) AND ( y < 20 )) OR (( x = x2 ) AND ( y = y2 ))
THEN
begin
clrscr;
TextColor (Cyan + Blink);
gotoxy (7,11);
writeln('##### ##### # # ##### ##### # # ##### #####');
gotoxy (7,12);
writeln('# # # # # # # # # # # # # #');
gotoxy (7,13);
writeln('# ### ##