Subversion Repositories Kolibri OS

Rev

Rev 762 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. program LodeRunnerLive;
  2.  
  3. {$apptype gui}
  4.  
  5.  
  6. uses
  7.   LRLRoutines,
  8.   LRLSprites,
  9.   LRLLevels,
  10.   LRLMainMenu,
  11.   LRLHighScores,
  12.   LRLEditor,
  13.   LRLIntroduction;
  14.  
  15. const
  16.   Version: PChar = 'Lode Runner LIVE. Version 1.5';
  17.  
  18.  
  19. procedure LRLInitialize;
  20. begin
  21.   ImagesInitialize;
  22.   KeyboardInitialize;
  23.   MouseInitialize;
  24.   ScreenMode(1);
  25.   ScreenTitle := Version;
  26. end;
  27.  
  28.  
  29. procedure LRLDeinitialize;
  30. begin
  31.   ImagesDeinitialize;
  32. end;
  33.  
  34.  
  35. procedure LRLGameStart;
  36. var
  37.   cl: Integer;
  38. begin
  39.   Palette256Set(LRLPalette^);
  40.  
  41.   ShowLives := True;
  42.   ShowScore := True;
  43.   ShowLevel := True;
  44.   LRLLives := 5;
  45.   LRLScore := 0;
  46.  
  47.   cl := 1;
  48.   repeat
  49.     LRLPlayLevel(cl);
  50.     KeyboardFlush;
  51.  
  52.     if GameResult = 10 then
  53.     begin
  54.       Inc(LRLLives);
  55.       LRLScore := LRLScore + 10000 * Longint(cl);
  56.       Inc(cl);
  57.     end else
  58.       Dec(LRLLives);
  59.   until (LRLLives = 0) or (GameResult = 100);
  60.  
  61.   if (GameResult <> 100) and LRLBestScore(LRLScore) then
  62.   begin
  63.     LRLInsertScore(LRLEnterName, LRLScore);
  64.     LRLShowHighScores;
  65.   end;
  66. end;
  67.  
  68. procedure LRLShell;
  69. var
  70.   MenuSelection: word;
  71. begin
  72.   MenuSelection := 1;
  73.   repeat
  74.     LRLSelectItem(MenuSelection);
  75.     if MenuSelection = 1 then LRLGameStart;
  76.     if MenuSelection = 2 then LRLEditLevels;
  77.     if MenuSelection = 3 then LRLShowHighScores;
  78.   until MenuSelection = 4;
  79. end;
  80.  
  81.  
  82. begin
  83.   LRLInitialize;
  84.   LRLIntro;
  85.   LRLShell;
  86.   LRLDeinitialize;
  87. end.
  88.