-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.inc
59 lines (46 loc) · 968 Bytes
/
main.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ main game loop }
Procedure Main;
Begin
CursorOff;
Randomize;
SetupDict;
MDist := 0;
CT := 0;
T := 0;
DC := 0;
NextDungeon := True;
While (NextDungeon) Do
Begin
GenerateDungeon;
GenerateItems;
GeneratePlayer;
GenerateMonsters;
DrawFrame;
DrawDungeon;
DrawPlayer;
DrawMonsters;
DrawStatus;
DrawScore;
{ L := 32767; }
While ((MDist <> 0) And (T < DT) And NextMove) Do
Begin
If (MovePlayer) Then DrawDungeon;
If D = 111 Then LightSpell;
DrawPlayer;
DrawMonsters;
MDist := HitMonster(CPlayer.X, CPlayer.Y);
DrawStatus;
DrawScore;
End;
{ if not win, then end game. Otherwise, new dungeon. }
If T < DT Then NextDungeon := False
Else DC := DC + 1;
End;
GotoXY(1,SHeight+1);
If (D = 666) Then
Begin
ClrScr;
DebugAll;
End;
CursorOn;
End;