Subversion Repositories Kolibri OS

Rev

Rev 762 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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