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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
#ifndef REFEREE_H
#define REFEREE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kapp.h>
#include <ntqwidget.h>
#include <ntqstrlist.h>
#include <ntqarray.h>
#include <ntqbitarry.h>
#include "board.h"
#include "pacman.h"
#include "monster.h"
#include "fruit.h"
#include "energizer.h"
#include "bitfont.h"
#include "painter.h"
enum { Init, Introducing, Playing, Demonstration, Paused, Player, Ready,
Scoring, LevelDone, Dying, GameOver, HallOfFame };
class Referee : public TQWidget
{
Q_OBJECT
public:
Referee (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0);
void setSkill(int);
void setRoom(int);
public slots:
void setScheme(int scheme, int mode, Bitfont *font=0);
void levelUp();
void levelUpPlay();
void pause();
void ready();
void intro();
void introPlay();
void hallOfFame();
void demo();
void play();
void killed();
void killedPlay();
void eaten();
void toggleHallOfFame();
void setFocusOutPause(bool focusOutPause);
void setFocusInContinue(bool focusInContinue);
void initKeys();
void repaintFigures();
private slots:
void start();
void stop();
void stopEnergizer();
signals:
void setScore(int, int);
void setPoints(int);
void setLevel(int);
void setLifes(int);
void focusedGamePause();
void forcedGameHighscores();
protected:
void timerEvent(TQTimerEvent *);
void paintEvent(TQPaintEvent *);
void keyPressEvent(TQKeyEvent *);
void focusOutEvent(TQFocusEvent *);
void focusInEvent(TQFocusEvent *);
void fillArray(TQArray<int> &, TQString, int);
void fillStrList(TQStrList &, TQString, int);
void fillMapName();
void confScheme();
void confLevels(bool defGroup=TRUE);
void confMisc(bool defGroup=TRUE);
void confTiming(bool defGroup=TRUE);
void confScoring(bool defGroup=TRUE);
private:
TQBitArray gameState;
int timerCount;
int maxLevel;
int scheme;
int mode;
TQString pixmapDirectory;
TQString mapDirectory;
TQStrList mapName;
TQArray<int> speed;
TQArray<int> monsterIQ;
TQArray<int> fruitIQ;
TQArray<int> fruitIndex;
TQArray<int> pacmanTicks;
TQArray<int> remTicks;
TQArray<int> dangerousTicks;
TQArray<int> harmlessTicks;
TQArray<int> harmlessDurTicks;
TQArray<int> harmlessWarnTicks;
TQArray<int> arrestTicks;
TQArray<int> arrestDurTicks;
TQArray<int> fruitTicks;
TQArray<int> fruitAppearsTicks;
TQArray<int> fruitDurTicks;
TQArray<int> fruitScoreDurTicks;
int monsterScoreDurMS;
int playerDurMS;
int readyDurMS;
int gameOverDurMS;
int afterPauseMS;
int dyingPreAnimationMS;
int dyingAnimationMS;
int dyingPostAnimationMS;
int introAnimationMS;
int introPostAnimationMS;
int levelUpPreAnimationMS;
int levelUpAnimationMS;
int energizerAnimationMS;
int pointScore;
int energizerScore;
TQArray<int> fruitScore;
TQArray<int> monsterScore;
TQArray<int> extraLifeScore;
int extraLifeScoreIndex;
int nextExtraLifeScore;
int monstersEaten;
int points;
int lifes;
int level;
bool focusedPause;
bool focusOutPause;
bool focusInContinue;
Board *board;
Painter *pix;
Pacman *pacman;
Fruit *fruit;
TQPtrList<Monster> *monsters;
TQPtrList<TQRect> *monsterRect;
TQPtrList<Energizer> *energizers;
TQPtrList<TQRect> *energizerRect;
TQRect pacmanRect;
TQRect fruitRect;
void introMonster(int id);
void introPaint(int t);
void initMonsters();
void initPacman();
void initFruit(bool fullInitialization=TRUE);
void initEnergizers();
void setOnEnergizers();
int gameTimer;
int energizerTimer;
void start(int);
void init(bool);
void score(int);
uint UpKey;
uint DownKey;
uint RightKey;
uint LeftKey;
};
#endif // REFEREE_H
|