You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB

Program Boulderman;
Uses
crt,
Math,
gameUnit,
dataUnit;
Var
filePath: String;
levelID: String;
theGS: GameState;
valid: boolean;
levelFound: boolean = true;
Begin
clrscr;
writeLn('<<< Boulderman >>');
If paramCount < 1 Then
Begin
filePath := './intro.kye';
writeLn('This is the introductory level set.');
writeLn('Play another level set by calling the game');
writeLn('with the path to the new level set file.');
End
Else
filePath := paramStr(1);
Repeat
writeLn('--- Menu ---');
writeLn('p -> Play');
writeLn('j -> Jump to level');
writeLn('q -> Quit');
repeat
valid := true;
Case readKey Of
'p': levelID := '';
'j': Begin
writeLn('What is the level name?');
readLn(levelID);
End;
'q': Exit;
else valid := false;
End;
until valid;
Repeat
theGS := readLevel(filePath, UpCase(levelID), levelFound);
If levelFound then
begin
playLevel(theGS);
levelID := theGS.next;
end
else
begin
writeLn('!!Level not found.');
writeLn('Press ENTER to contiue.');
readLn;
end;
Until (not levelFound) or (theGS.goal <> 0) or (length(levelID) = 0);
clrscr;
Until false;
End.