42 lines
854 B
ObjectPascal
42 lines
854 B
ObjectPascal
|
|
program go_hamster;
|
||
|
|
|
||
|
|
uses crt, graphics_m, game_m;
|
||
|
|
|
||
|
|
function IsTerminalValid: boolean;
|
||
|
|
begin
|
||
|
|
IsTerminalValid := (
|
||
|
|
(ScreenWidth >= ScreenW * WidthCoefficient)
|
||
|
|
and (ScreenHeight >= ScreenH)
|
||
|
|
)
|
||
|
|
end;
|
||
|
|
|
||
|
|
procedure PrintTerminalHelp;
|
||
|
|
begin
|
||
|
|
writeln('Increase your terminal size and try again.');
|
||
|
|
if ScreenWidth < ScreenW * WidthCoefficient then
|
||
|
|
begin
|
||
|
|
writeln('Your terminal width: ', ScreenWidth,
|
||
|
|
'. Required: ', ScreenW * WidthCoefficient, '.')
|
||
|
|
end;
|
||
|
|
if ScreenHeight < ScreenH then
|
||
|
|
begin
|
||
|
|
writeln('Your terminal height: ', ScreenHeight,
|
||
|
|
'. Required: ', ScreenH, '.')
|
||
|
|
end
|
||
|
|
end;
|
||
|
|
|
||
|
|
var
|
||
|
|
g: gameState;
|
||
|
|
begin
|
||
|
|
if not IsTerminalValid then
|
||
|
|
begin
|
||
|
|
PrintTerminalHelp;
|
||
|
|
exit
|
||
|
|
end;
|
||
|
|
clrscr;
|
||
|
|
InitGame(g);
|
||
|
|
EraseAll;
|
||
|
|
MainLoop(g)
|
||
|
|
end.
|
||
|
|
|