Subversion Repositories spacemission

Rev

Rev 1 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 2
Line 3... Line 3...
3
interface
3
interface
4
 
4
 
5
uses
5
uses
6
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, MMSystem, Dialogs,
6
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, MMSystem, Dialogs,
7
  StdCtrls, ExtCtrls, Menus, SplInfo, DIB, DXClass, DXSprite, DXDraws, DXInput,
7
  StdCtrls, ExtCtrls, Menus, SplInfo, DIB, DXClass, DXSprite, DXDraws, DXInput,
8
  DXSounds, PJVersionInfo, INIFiles, shellapi, wininet;
8
  DXSounds, INIFiles, ShellAPI, wininet;
9
 
9
 
10
type
10
type
11
  TGameScene = (
11
  TGameScene = (
12
    gsNone,
12
    gsNone,
13
    gsTitle,
13
    gsTitle,
Line 18... Line 18...
18
  );
18
  );
19
 
19
 
20
  TGameInterval = (
20
  TGameInterval = (
21
    giMittel,
21
    giMittel,
22
    giLeicht,
22
    giLeicht,
23
    giSchwer
23
    giSchwer,
-
 
24
    giMaster
24
  );
25
  );
25
 
26
 
26
  TMusicTrack = (
27
  TMusicTrack = (
27
    mtNone,
28
    mtNone,
28
    mtGame,
29
    mtGame,
Line 41... Line 42...
41
    sfEnde,
42
    sfEnde,
42
    sfFrage,
43
    sfFrage,
43
    sfLevIntro
44
    sfLevIntro
44
  );}
45
  );}
45
 
46
 
46
  TMainForm = class(TDXForm)
-
 
47
    MainMenu: TMainMenu;
-
 
48
    Spiel: TMenuItem;
-
 
49
    GameStart: TMenuItem;
-
 
50
    GamePause: TMenuItem;
-
 
51
    Beenden: TMenuItem;
-
 
52
    Einstellungen: TMenuItem;
-
 
53
    OptionFullScreen: TMenuItem;
-
 
54
    OptionMusic: TMenuItem;
-
 
55
    Leer2: TMenuItem;
-
 
56
    Leer4: TMenuItem;
-
 
57
    Hilfe: TMenuItem;
-
 
58
    OptionSound: TMenuItem;
-
 
59
    Mitarbeiter: TMenuItem;
-
 
60
    Leer3: TMenuItem;
-
 
61
    Spielstand: TMenuItem;
-
 
62
    Leer5: TMenuItem;
-
 
63
    Neustart: TMenuItem;
-
 
64
    OptionBreitbild: TMenuItem;
-
 
65
    Spielgeschwindigkeit: TMenuItem;
-
 
66
    Leicht: TMenuItem;
-
 
67
    Mittel: TMenuItem;
-
 
68
    Schwer: TMenuItem;
-
 
69
    Informationen: TMenuItem;
-
 
70
    Leer6: TMenuItem;
-
 
71
    Leer1: TMenuItem;
-
 
72
    Cheat: TMenuItem;
-
 
73
    AufUpdatesprfen1: TMenuItem;
-
 
74
    procedure DXDrawFinalize(Sender: TObject);
-
 
75
    procedure DXDrawInitialize(Sender: TObject);
-
 
76
    procedure FormCreate(Sender: TObject);
-
 
77
    procedure DXTimerTimer(Sender: TObject; LagCount: Integer);
-
 
78
    procedure DXTimerActivate(Sender: TObject);
-
 
79
    procedure DXTimerDeactivate(Sender: TObject);
-
 
80
    procedure OptionFullScreenClick(Sender: TObject);
-
 
81
    procedure DXDrawInitializing(Sender: TObject);
-
 
82
    procedure GameStartClick(Sender: TObject);
-
 
83
    procedure GamePauseClick(Sender: TObject);
-
 
84
    procedure BeendenClick(Sender: TObject);
-
 
85
    procedure OptionSoundClick(Sender: TObject);
-
 
86
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
-
 
87
    procedure OptionMusicClick(Sender: TObject);
-
 
88
    procedure MitarbeiterClick(Sender: TObject);
-
 
89
    procedure SpielstandClick(Sender: TObject);
-
 
90
    procedure NeustartClick(Sender: TObject);
-
 
91
    procedure OptionBreitbildClick(Sender: TObject);
-
 
92
    procedure LeichtClick(Sender: TObject);
-
 
93
    procedure MittelClick(Sender: TObject);
-
 
94
    procedure SchwerClick(Sender: TObject);
-
 
95
    procedure FormShow(Sender: TObject);
-
 
96
    procedure InformationenClick(Sender: TObject);
-
 
97
    procedure CheatClick(Sender: TObject);
-
 
98
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
-
 
99
    procedure FormDestroy(Sender: TObject);
-
 
100
    procedure AufUpdatesprfen1Click(Sender: TObject);
-
 
101
  private
-
 
102
    FInterval: TGameInterval;
-
 
103
    FScene: TGameScene;
-
 
104
    FMusic: TMusicTrack;
-
 
105
    FBlink: DWORD;
-
 
106
    FBlinkTime: DWORD;
-
 
107
    FFrame, FAngle, FCounter, FEnemyAdventPos: Integer;
-
 
108
    procedure StartScene(Scene: TGameScene);
-
 
109
    procedure EndScene;
-
 
110
    procedure BlinkStart;
-
 
111
    procedure BlinkUpdate;
-
 
112
    procedure StartSceneTitle;
-
 
113
    procedure SceneTitle;
-
 
114
    procedure EndSceneTitle;
-
 
115
    procedure StartSceneMain;
-
 
116
    procedure SceneMain;
-
 
117
    procedure EndSceneMain;
-
 
118
    procedure StartSceneGameOver;
-
 
119
    procedure SceneGameOver;
-
 
120
    procedure EndSceneGameOver;
-
 
121
    procedure StartSceneWin;
-
 
122
    procedure SceneWin;
-
 
123
    procedure EndSceneWin;
-
 
124
    procedure StartSceneNewLevel;
-
 
125
    procedure SceneNewLevel;
-
 
126
    procedure EndSceneNewLevel;
-
 
127
  public
-
 
128
    FDirectory: string;
-
 
129
    FEngineVersion: string;
-
 
130
    FNextScene: TGameScene;
-
 
131
    FScore: Integer;
-
 
132
    FNotSave: boolean;
-
 
133
    FLife: integer;
-
 
134
    FLevel: integer;
-
 
135
    FMenuItem: integer;
-
 
136
    FBossLife: integer;
-
 
137
    FRestEnemys: integer;
-
 
138
    FCheat: boolean;
-
 
139
    { VCL-Ersatz }
-
 
140
    dxdraw: TDxDraw;
-
 
141
    imagelist: TDxImageList;
-
 
142
    spriteengine: tdxspriteengine;
-
 
143
    dxsound: tdxsound;
-
 
144
    wavelist: tdxwavelist;
-
 
145
    dxinput: tdxinput;
-
 
146
    dxtimer: tdxtimer;
-
 
147
    versioninfo: tpjversioninfo;
-
 
148
    { Level-Routinen }
-
 
149
    procedure NewLevel(lev: integer);
-
 
150
    procedure DeleteArray;
-
 
151
    { MCI-Routinen }
-
 
152
    function StatusMusic(Name: TMusicTrack): string;
-
 
153
    procedure PlayMusic(Name: TMusicTrack);
-
 
154
    //procedure StopMusic(Name: TMusicTrack);
-
 
155
    procedure PauseMusic(Name: TMusicTrack);
-
 
156
    procedure ResumeMusic(Name: TMusicTrack);
-
 
157
    procedure DestroyMusic(Name: TMusicTrack);
-
 
158
    procedure OpenMusic(Name: TMusicTrack);
-
 
159
    { Sound-Routinen }
-
 
160
    function SoundKarte: boolean;
-
 
161
    procedure PlaySound(Name: string; Wait: Boolean);
-
 
162
    { Initialisiations-Routinen }
-
 
163
    procedure DXInit;
-
 
164
    procedure SoundInit;
-
 
165
    procedure MusicInit;
-
 
166
    { Einstellungs-Routinen }
-
 
167
    procedure LoadOptions;
-
 
168
    procedure WriteOptions;
-
 
169
    { Farb-Routinen }
-
 
170
    function ComposeColor(Dest, Src: TRGBQuad; Percent: Integer): TRGBQuad;
-
 
171
    procedure PalleteAnim(Col: TRGBQuad; Time: Integer);
-
 
172
  end;
-
 
173
 
-
 
174
var
-
 
175
  MainForm: TMainForm;
-
 
176
 
-
 
177
const
-
 
178
  conleicht = 650 div 60;
-
 
179
  conmittel = 1000 div 60;
-
 
180
  conschwer = 1350 div 60;
-
 
181
  lives = 6;
-
 
182
  FCompVersion = '1.0';
-
 
183
 
-
 
184
implementation
-
 
185
 
-
 
186
uses
-
 
187
  SplSplash, SplSpeicherung, SplText, SplCheat;
-
 
188
 
-
 
189
const
-
 
190
  FileError = 'Die Datei kann von SpaceMission nicht geöffnet werden!';
-
 
191
 
-
 
192
{$R *.DFM}
-
 
193
 
-
 
194
{$R WindowsXP.res}
-
 
195
 
-
 
196
type
-
 
197
 
-
 
198
  TBackground = class(TBackgroundSprite)
47
  TBackground = class(TBackgroundSprite)
199
  private
48
  private
200
    FSpeed: Double;
49
    FSpeed: Double;
201
  protected
50
  protected
202
    procedure DoMove(MoveCount: Integer); override;
51
    procedure DoMove(MoveCount: Integer); override;
Line 227... Line 76...
227
  protected
76
  protected
228
    procedure DoCollision(Sprite: TSprite; var Done: Boolean); override;
77
    procedure DoCollision(Sprite: TSprite; var Done: Boolean); override;
229
    procedure DoMove(MoveCount: Integer); override;
78
    procedure DoMove(MoveCount: Integer); override;
230
  public
79
  public
231
    constructor Create(AParent: TSprite); override;
80
    constructor Create(AParent: TSprite); override;
-
 
81
    procedure FlyAway;
232
  end;
82
  end;
233
 
83
 
234
  TTamaSprite = class(TImageSprite)
84
  TTamaSprite = class(TImageSprite)
235
  private
85
  private
236
    FPlayerSprite: TPlayerSprite;
86
    FPlayerSprite: TPlayerSprite;
Line 247... Line 97...
247
    FCounter: Integer;
97
    FCounter: Integer;
248
    FLife: integer;
98
    FLife: integer;
249
    FMode: Integer;
99
    FMode: Integer;
250
    procedure Hit; virtual;
100
    procedure Hit; virtual;
251
  protected
101
  protected
252
    procedure HitEnemy(Deaded: Boolean); virtual;
102
    procedure HitEnemy(ADead: Boolean); virtual;
253
  public
103
  public
254
    constructor Create(AParent: TSprite); override;
104
    constructor Create(AParent: TSprite); override;
255
    destructor Destroy; override;
105
    destructor Destroy; override;
256
  end;
106
  end;
257
 
107
 
Line 265... Line 115...
265
  end;
115
  end;
266
 
116
 
267
  TEnemyMeteor= class(TEnemy)
117
  TEnemyMeteor = class(TEnemy)
268
  protected
118
  protected
269
    procedure DoMove(MoveCount: Integer); override;
119
    procedure DoMove(MoveCount: Integer); override;
270
    procedure HitEnemy(Deaded: Boolean); override;
120
    procedure HitEnemy(ADead: Boolean); override;
271
  public
121
  public
272
    constructor Create(AParent: TSprite); override;
122
    constructor Create(AParent: TSprite); override;
273
  end;
123
  end;
274
 
124
 
275
  TEnemyUFO = class(TEnemy)
125
  TEnemyUFO = class(TEnemy)
276
  protected
126
  protected
277
    procedure DoMove(MoveCount: Integer); override;
127
    procedure DoMove(MoveCount: Integer); override;
278
    procedure HitEnemy(Deaded: Boolean); override;
128
    procedure HitEnemy(ADead: Boolean); override;
279
  public
129
  public
280
    constructor Create(AParent: TSprite); override;
130
    constructor Create(AParent: TSprite); override;
281
  end;
131
  end;
282
 
132
 
283
  TEnemyUFO2 = class(TEnemy)
133
  TEnemyUFO2 = class(TEnemy)
Line 285... Line 135...
285
    FCounter: Integer;
135
    FCounter: Integer;
286
    FTamaCount: Integer;
136
    FTamaCount: Integer;
287
    FOldTamaTime: Integer;
137
    FOldTamaTime: Integer;
288
  protected
138
  protected
289
    procedure DoMove(MoveCount: Integer); override;
139
    procedure DoMove(MoveCount: Integer); override;
290
    procedure HitEnemy(Deaded: Boolean); override;
140
    procedure HitEnemy(ADead: Boolean); override;
291
  public
141
  public
292
    constructor Create(AParent: TSprite); override;
142
    constructor Create(AParent: TSprite); override;
293
  end;
143
  end;
294
 
144
 
295
  TEnemyAttacker = class(TEnemy)
145
  TEnemyAttacker = class(TEnemy)
296
  protected
146
  protected
297
    procedure DoMove(MoveCount: Integer); override;
147
    procedure DoMove(MoveCount: Integer); override;
298
    procedure HitEnemy(Deaded: Boolean); override;
148
    procedure HitEnemy(ADead: Boolean); override;
299
  public
149
  public
300
    constructor Create(AParent: TSprite); override;
150
    constructor Create(AParent: TSprite); override;
301
  end;
151
  end;
302
 
152
 
303
  TEnemyAttacker2 = class(TEnemy)
153
  TEnemyAttacker2 = class(TEnemy)
Line 306... Line 156...
306
    FTamaF: Integer;
156
    FTamaF: Integer;
307
    FTamaT: Integer;
157
    FTamaT: Integer;
308
    FPutTama: Boolean;
158
    FPutTama: Boolean;
309
  protected
159
  protected
310
    procedure DoMove(MoveCount: Integer); override;
160
    procedure DoMove(MoveCount: Integer); override;
311
    procedure HitEnemy(Deaded: Boolean); override;
161
    procedure HitEnemy(ADead: Boolean); override;
312
  public
162
  public
313
    constructor Create(AParent: TSprite); override;
163
    constructor Create(AParent: TSprite); override;
314
  end;
164
  end;
315
 
165
 
316
  TEnemyAttacker3 = class(TEnemy)
166
  TEnemyAttacker3 = class(TEnemy)
Line 318... Line 168...
318
    FCounter: Integer;
168
    FCounter: Integer;
319
    FTamaCount: Integer;
169
    FTamaCount: Integer;
320
    FOldTamaTime: Integer;
170
    FOldTamaTime: Integer;
321
  protected
171
  protected
322
    procedure DoMove(MoveCount: Integer); override;
172
    procedure DoMove(MoveCount: Integer); override;
323
    procedure HitEnemy(Deaded: Boolean); override;
173
    procedure HitEnemy(ADead: Boolean); override;
324
  public
174
  public
325
    constructor Create(AParent: TSprite); override;
175
    constructor Create(AParent: TSprite); override;
326
  end;
176
  end;
327
 
177
 
328
  TEnemyBoss = class(TEnemy)
178
  TEnemyBoss = class(TEnemy)
Line 332... Line 182...
332
    FTamaT: Integer;
182
    FTamaT: Integer;
333
    FPutTama: Boolean;
183
    FPutTama: Boolean;
334
    waiter1, waiter2: integer;
184
    waiter1, waiter2: integer;
335
  protected
185
  protected
336
    procedure DoMove(MoveCount: Integer); override;
186
    procedure DoMove(MoveCount: Integer); override;
337
    procedure HitEnemy(Deaded: Boolean); override;
187
    procedure HitEnemy(ADead: Boolean); override;
338
  public
188
  public
339
    constructor Create(AParent: TSprite); override;
189
    constructor Create(AParent: TSprite); override;
340
  end;
190
  end;
341
 
191
 
342
  TNoting = class(TImageSprite);
192
  TNothing = class(TImageSprite);
343
 
193
 
344
  TSpriteClass = class of TSprite;
194
  TSpriteClass = class of TSprite;
345
 
195
 
346
  TEnemyAdvent = record
196
  TEnemyAdvent = record
347
    c: TSpriteClass;
197
    spriteClass: TSpriteClass;
348
    x: extended;
198
    x: extended;
349
    y: extended;
199
    y: extended;
350
    l: integer;
200
    lifes: integer;
-
 
201
  end;
-
 
202
 
-
 
203
  TMainForm = class(TDXForm)
-
 
204
    MainMenu: TMainMenu;
-
 
205
    Spiel: TMenuItem;
-
 
206
    GameStart: TMenuItem;
-
 
207
    GamePause: TMenuItem;
-
 
208
    Beenden: TMenuItem;
-
 
209
    Einstellungen: TMenuItem;
-
 
210
    OptionFullScreen: TMenuItem;
-
 
211
    OptionMusic: TMenuItem;
-
 
212
    Leer2: TMenuItem;
-
 
213
    Leer4: TMenuItem;
-
 
214
    Hilfe: TMenuItem;
-
 
215
    OptionSound: TMenuItem;
-
 
216
    Mitarbeiter: TMenuItem;
-
 
217
    Leer3: TMenuItem;
-
 
218
    Spielstand: TMenuItem;
-
 
219
    Leer5: TMenuItem;
-
 
220
    Neustart: TMenuItem;
-
 
221
    OptionBreitbild: TMenuItem;
-
 
222
    Spielgeschwindigkeit: TMenuItem;
-
 
223
    Leicht: TMenuItem;
-
 
224
    Mittel: TMenuItem;
-
 
225
    Schwer: TMenuItem;
-
 
226
    Informationen: TMenuItem;
-
 
227
    Leer6: TMenuItem;
-
 
228
    Leer1: TMenuItem;
-
 
229
    Cheat: TMenuItem;
-
 
230
    CheckUpdates: TMenuItem;
-
 
231
    Master: TMenuItem;
-
 
232
    procedure DXDrawFinalize(Sender: TObject);
-
 
233
    procedure DXDrawInitialize(Sender: TObject);
-
 
234
    procedure FormCreate(Sender: TObject);
-
 
235
    procedure DXTimerTimer(Sender: TObject; LagCount: Integer);
-
 
236
    procedure DXTimerActivate(Sender: TObject);
-
 
237
    procedure DXTimerDeactivate(Sender: TObject);
-
 
238
    procedure OptionFullScreenClick(Sender: TObject);
-
 
239
    procedure DXDrawInitializing(Sender: TObject);
-
 
240
    procedure GameStartClick(Sender: TObject);
-
 
241
    procedure GamePauseClick(Sender: TObject);
-
 
242
    procedure BeendenClick(Sender: TObject);
-
 
243
    procedure OptionSoundClick(Sender: TObject);
-
 
244
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
-
 
245
    procedure OptionMusicClick(Sender: TObject);
-
 
246
    procedure MitarbeiterClick(Sender: TObject);
-
 
247
    procedure SpielstandClick(Sender: TObject);
-
 
248
    procedure NeustartClick(Sender: TObject);
-
 
249
    procedure OptionBreitbildClick(Sender: TObject);
-
 
250
    procedure LeichtClick(Sender: TObject);
-
 
251
    procedure MittelClick(Sender: TObject);
-
 
252
    procedure SchwerClick(Sender: TObject);
-
 
253
    procedure FormShow(Sender: TObject);
-
 
254
    procedure InformationenClick(Sender: TObject);
-
 
255
    procedure CheatClick(Sender: TObject);
-
 
256
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
-
 
257
    procedure FormDestroy(Sender: TObject);
-
 
258
    procedure CheckUpdatesClick(Sender: TObject);
-
 
259
    procedure MasterClick(Sender: TObject);
-
 
260
  private
-
 
261
    ProgrammGestartet: boolean;
-
 
262
    FInterval: TGameInterval;
-
 
263
    FScene: TGameScene;
-
 
264
    FMusic: TMusicTrack;
-
 
265
    FBlink: DWORD;
-
 
266
    FBlinkTime: DWORD;
-
 
267
    FFrame, FAngle, FCounter, FEnemyAdventPos: Integer;
-
 
268
    PlayerSprite: TPlayerSprite;
-
 
269
    procedure StartScene(Scene: TGameScene);
-
 
270
    procedure EndScene;
-
 
271
    procedure BlinkStart;
-
 
272
    procedure BlinkUpdate;
-
 
273
    procedure StartSceneTitle;
-
 
274
    procedure SceneTitle;
-
 
275
    procedure EndSceneTitle;
-
 
276
    procedure StartSceneMain;
-
 
277
    procedure SceneMain;
-
 
278
    procedure EndSceneMain;
-
 
279
    procedure StartSceneGameOver;
-
 
280
    procedure SceneGameOver;
-
 
281
    procedure EndSceneGameOver;
-
 
282
    procedure StartSceneWin;
-
 
283
    procedure SceneWin;
-
 
284
    procedure EndSceneWin;
-
 
285
    procedure StartSceneNewLevel;
-
 
286
    procedure SceneNewLevel;
-
 
287
    procedure EndSceneNewLevel;
-
 
288
  public
-
 
289
    FNextScene: TGameScene;
-
 
290
    FScore: Integer;
-
 
291
    FNotSave: boolean;
-
 
292
    FLife: integer;
-
 
293
    FLevel: integer;
-
 
294
    FMenuItem: integer;
-
 
295
    FBossLife: integer;
-
 
296
    FRestEnemys: integer;
-
 
297
    FCheat: boolean;
-
 
298
    { VCL-Ersatz }
-
 
299
    dxdraw: TDxDraw;
-
 
300
    imagelist: TDxImageList;
-
 
301
    spriteengine: tdxspriteengine;
-
 
302
    dxsound: tdxsound;
-
 
303
    wavelist: tdxwavelist;
-
 
304
    dxinput: tdxinput;
-
 
305
    dxtimer: tdxtimer;
-
 
306
    { Level-Routinen }
-
 
307
    procedure NewLevel(lev: integer);
-
 
308
    procedure DeleteArray;
-
 
309
    { MCI-Routinen }
-
 
310
    function StatusMusic(Name: TMusicTrack): string;
-
 
311
    procedure PlayMusic(Name: TMusicTrack);
-
 
312
    //procedure StopMusic(Name: TMusicTrack);
-
 
313
    procedure PauseMusic(Name: TMusicTrack);
-
 
314
    procedure ResumeMusic(Name: TMusicTrack);
-
 
315
    procedure DestroyMusic(Name: TMusicTrack);
-
 
316
    procedure OpenMusic(Name: TMusicTrack);
-
 
317
    { Sound-Routinen }
-
 
318
    function SoundKarte: boolean;
-
 
319
    procedure PlaySound(Name: string; Wait: Boolean);
-
 
320
    { Initialisiations-Routinen }
-
 
321
    procedure DXInit;
-
 
322
    procedure SoundInit;
-
 
323
    procedure MusicInit;
-
 
324
    { Einstellungs-Routinen }
-
 
325
    procedure LoadOptions;
-
 
326
    procedure WriteOptions;
-
 
327
    { Farb-Routinen }
-
 
328
    function ComposeColor(Dest, Src: TRGBQuad; Percent: Integer): TRGBQuad;
-
 
329
    procedure PalleteAnim(Col: TRGBQuad; Time: Integer);
351
  end;
330
  end;
352
 
331
 
353
var
332
var
-
 
333
  MainForm: TMainForm;
-
 
334
 
-
 
335
const
-
 
336
  conleicht = 650 div 60; // 10
-
 
337
  conmittel = 1000 div 60; // 16
-
 
338
  conschwer = 1350 div 60; // 22
-
 
339
  conmaster = 2000 div 60; // 33
-
 
340
  lives = 6;
-
 
341
 
-
 
342
implementation
-
 
343
 
-
 
344
uses
-
 
345
  SplSplash, SplSpeicherung, SplText, SplCheat, Global;
-
 
346
 
-
 
347
resourcestring
-
 
348
  FileError = 'Die Datei kann von SpaceMission nicht geöffnet werden!';
-
 
349
 
-
 
350
{$R *.DFM}
-
 
351
 
-
 
352
{$R WindowsXP.res}
-
 
353
 
-
 
354
var // TODO: irgendwo hinpacken. irgendwo!!!
354
  EnemyAdventTable: array[0..9999] of TEnemyAdvent;
355
  EnemyAdventTable: array[0..9999] of TEnemyAdvent; // TODO: dyn
355
  Crash2, ec: integer;
356
  Crash2, ec: integer;
356
  BossExists, Crash, crashsound, SpielerFliegtFort: boolean;
357
  BossExists, Crash, crashsound: boolean;
357
  pos: array[1..4] of integer;
358
  pos: array[1..4] of integer;
358
  enemys: array[1..27] of TSpriteClass;
359
  enemys: array[1..27] of TSpriteClass;
-
 
360
  levact: integer;
359
 
361
 
360
const
362
const
361
  DXInputButton = [isButton1, isButton2, isButton3,
363
  DXInputButton = [isButton1, isButton2, isButton3,
362
    isButton4, isButton5, isButton6, isButton7, isButton8, isButton9, isButton10, isButton11,
364
    isButton4, isButton5, isButton6, isButton7, isButton8, isButton9, isButton10, isButton11,
363
    isButton12, isButton13, isButton14, isButton15, isButton16, isButton17, isButton18,
365
    isButton12, isButton13, isButton14, isButton15, isButton16, isButton17, isButton18,
364
    isButton19, isButton20, isButton21, isButton22, isButton23, isButton24, isButton25,
366
    isButton19, isButton20, isButton21, isButton22, isButton23, isButton24, isButton25,
365
    isButton26, isButton27, isButton28, isButton29, isButton30, isButton31, isButton32];
367
    isButton26, isButton27, isButton28, isButton29, isButton30, isButton31, isButton32];
366
 
368
 
-
 
369
const // TODO: Auch für Enemies
-
 
370
  PLAYER_MODE_NORMAL = 0;
-
 
371
  PLAYER_MODE_DEAD = 1;
-
 
372
  PLAYER_MODE_DEAD_VANISHED = 2;
-
 
373
  PLAYER_MODE_FLYAWAY = 3;
-
 
374
  PLAYER_MODE_ENTER = 4;
-
 
375
 
-
 
376
// TODO: Code komplett überarbeiten. Bessere Ableitungen machen
-
 
377
 
367
constructor TPlayerSprite.Create(AParent: TSprite);
378
constructor TPlayerSprite.Create(AParent: TSprite);
368
begin
379
begin
369
  inherited Create(AParent);
380
  inherited Create(AParent);
370
  Image := MainForm.ImageList.Items.Find('Machine');
381
  Image := MainForm.ImageList.Items.Find('Machine');
371
  Width := Image.Width;
382
  Width := Image.Width;
Line 374... Line 385...
374
  Y := mainform.dxdraw.surfaceHeight / 2 - (height / 2);
385
  Y := mainform.dxdraw.surfaceHeight / 2 - (height / 2);
375
  Z := 2;
386
  Z := 2;
376
  AnimCount := Image.PatternCount;
387
  AnimCount := Image.PatternCount;
377
  AnimLooped := True;
388
  AnimLooped := True;
378
  AnimSpeed := 15/1000;
389
  AnimSpeed := 15/1000;
379
  FMode := 4;
390
  FMode := PLAYER_MODE_ENTER;
380
end;
391
end;
381
 
392
 
382
procedure TPlayerSprite.DoCollision(Sprite: TSprite; var Done: Boolean);
393
procedure TPlayerSprite.DoCollision(Sprite: TSprite; var Done: Boolean);
383
begin
394
begin
384
  if mainform.FCheat then exit;
395
  if mainform.FCheat then exit;
Line 391... Line 402...
391
      if MainForm.Flife=0 then
402
      if MainForm.Flife=0 then
392
      begin
403
      begin
393
        MainForm.PlaySound('Explosion', false);
404
        MainForm.PlaySound('Explosion', false);
394
        Collisioned := false;
405
        Collisioned := false;
395
        FCounter := 0;
406
        FCounter := 0;
396
        FMode := 1;
407
        FMode := PLAYER_MODE_DEAD;
397
        Done := false;
408
        Done := false;
398
        Image := MainForm.ImageList.Items.Find('Explosion');
409
        Image := MainForm.ImageList.Items.Find('Explosion');
399
        Width := Image.Width;
410
        Width := Image.Width;
400
        Height := Image.Height;
411
        Height := Image.Height;
401
        AnimCount := Image.PatternCount;
412
        AnimCount := Image.PatternCount;
Line 414... Line 425...
414
    end;
425
    end;
415
  end;
426
  end;
416
end;
427
end;
417
 
428
 
418
procedure TPlayerSprite.DoMove(MoveCount: Integer);
429
procedure TPlayerSprite.DoMove(MoveCount: Integer);
-
 
430
const
-
 
431
  WegduesKonstante = 1.75;
419
begin
432
begin
420
  inherited DoMove(MoveCount);
433
  inherited DoMove(MoveCount);
421
  if SpielerFliegtFort then FMode := 3;
-
 
422
  if FMode=0 then
434
  if FMode=PLAYER_MODE_NORMAL then
423
  begin
435
  begin
424
    if isUp in MainForm.DXInput.States then Y := Y - (250/1000)*MoveCount;
436
    if isUp in MainForm.DXInput.States then Y := Y - (250/1000)*MoveCount;
425
    if isDown in MainForm.DXInput.States then Y := Y + (250/1000)*MoveCount;
437
    if isDown in MainForm.DXInput.States then Y := Y + (250/1000)*MoveCount;
426
    if isLeft in MainForm.DXInput.States then X := X - (250/1000)*MoveCount;
438
    if isLeft in MainForm.DXInput.States then X := X - (250/1000)*MoveCount;
427
    if isRight in MainForm.DXInput.States then X := X + (250/1000)*MoveCount;
439
    if isRight in MainForm.DXInput.States then X := X + (250/1000)*MoveCount;
Line 443... Line 455...
443
        end;
455
        end;
444
        FOldTamaTime := FCounter;
456
        FOldTamaTime := FCounter;
445
      end;
457
      end;
446
    end;
458
    end;
447
    Collision;
459
    Collision;
448
  end else if FMode=1 then
460
  end else if FMode=PLAYER_MODE_DEAD then
449
  begin
461
  begin
450
    if FCounter>200 then
462
    if FCounter>200 then
451
    begin
463
    begin
452
      FCounter := 0;
464
      FCounter := 0;
453
      FMode := 2;
465
      FMode := PLAYER_MODE_DEAD_VANISHED;
454
      Visible := false;
466
      Visible := false;
455
    end;
467
    end;
456
  end else if FMode=2 then
468
  end else if FMode=PLAYER_MODE_DEAD_VANISHED then
457
  begin
469
  begin
458
    if FCounter>1500 then
470
    if FCounter>1500 then
459
    begin
471
    begin
460
      MainForm.FNextScene := gsGameOver;
472
      MainForm.FNextScene := gsGameOver;
461
      MainForm.PlaySound('SceneMov', false);
473
      MainForm.PlaySound('SceneMov', false);
462
      MainForm.PalleteAnim(RGBQuad(0, 0, 0), 300);
474
      MainForm.PalleteAnim(RGBQuad(0, 0, 0), 300);
463
      Sleep(200);
475
      Sleep(200);
464
    end;
476
    end;
465
  end else if FMode=3 then
477
  end else if FMode=PLAYER_MODE_FLYAWAY then
466
  begin
478
  begin
-
 
479
    // FUT: "Wusch" sound?
467
    X := X + MoveCount*(300/1000);
480
    X := X + MoveCount*(300/1000) * (X/MainForm.DXDraw.Width + WegduesKonstante);
468
    if X > MainForm.DXDraw.Width+Width then
481
    if X > MainForm.DXDraw.Width+Width then
469
    begin
482
    begin
470
      Dead;
483
      Dead;
471
      inc(mainform.FLevel);
484
      inc(mainform.FLevel);
472
      MainForm.FNextScene := gsNewLevel;
485
      MainForm.FNextScene := gsNewLevel;
473
      MainForm.PlaySound('SceneMov', false);
486
      MainForm.PlaySound('SceneMov', false);
474
      MainForm.PalleteAnim(RGBQuad(0, 0, 0), 300);
487
      MainForm.PalleteAnim(RGBQuad(0, 0, 0), 300);
475
    end;
488
    end;
476
  end else if FMode=4 then
489
  end else if FMode = PLAYER_MODE_ENTER then
477
  begin
490
  begin
478
    X := X + MoveCount*(300/1000);
491
    X := X + MoveCount*(300/1000);
479
    if X > 19 then FMode := 0;
492
    if X > 19 then FMode := PLAYER_MODE_NORMAL;
480
  end;
493
  end;
481
  inc(FCounter, MoveCount);
494
  inc(FCounter, MoveCount);
482
end;
495
end;
483
 
496
 
-
 
497
procedure TPlayerSprite.FlyAway;
-
 
498
begin
-
 
499
  FMode := PLAYER_MODE_FLYAWAY;
-
 
500
end;
-
 
501
 
484
procedure TMainForm.DXInit;
502
procedure TMainForm.DXInit;
485
begin
503
begin
486
  try
504
  try
487
    Imagelist.Items.LoadFromFile(FDirectory+'DirectX\Graphic.dxg');
505
    Imagelist.Items.LoadFromFile(FDirectory+'DirectX\Graphic.dxg');
488
    ImageList.Items.MakeColorTable;
506
    ImageList.Items.MakeColorTable;
Line 689... Line 707...
689
  end
707
  end
690
  else
708
  else
691
    HitEnemy(False);
709
    HitEnemy(False);
692
end;
710
end;
693
 
711
 
694
procedure TEnemy.HitEnemy(Deaded: Boolean);
712
procedure TEnemy.HitEnemy(ADead: Boolean);
695
begin
713
begin
696
  if Deaded then MainForm.PlaySound('Explosion', False);
714
  if ADead then MainForm.PlaySound('Explosion', False);
697
end;
715
end;
698
 
716
 
699
constructor TEnemyUFO.Create(AParent: TSprite);
717
constructor TEnemyUFO.Create(AParent: TSprite);
700
begin
718
begin
701
  inherited Create(AParent);
719
  inherited Create(AParent);
Line 703... Line 721...
703
  Width := Image.Width;
721
  Width := Image.Width;
704
  Height := Image.Height;
722
  Height := Image.Height;
705
  AnimCount := Image.PatternCount;
723
  AnimCount := Image.PatternCount;
706
  AnimLooped := True;
724
  AnimLooped := True;
707
  AnimSpeed := 15/1000;
725
  AnimSpeed := 15/1000;
708
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
726
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
709
end;
727
end;
710
 
728
 
711
constructor TEnemy.Create(AParent: TSprite);
729
constructor TEnemy.Create(AParent: TSprite);
712
begin
730
begin
713
  inherited Create(AParent);
731
  inherited Create(AParent);
Line 719... Line 737...
719
begin
737
begin
720
  inherited Destroy;
738
  inherited Destroy;
721
  dec(ec);
739
  dec(ec);
722
end;
740
end;
723
 
741
 
724
procedure TEnemyUFO.HitEnemy(Deaded: Boolean);
742
procedure TEnemyUFO.HitEnemy(ADead: Boolean);
725
begin
743
begin
726
  if Deaded then
744
  if ADead then
727
  begin
745
  begin
728
    MainForm.PlaySound('Explosion', False);
746
    MainForm.PlaySound('Explosion', False);
729
    FMode := 2;
747
    FMode := 2;
730
    FCounter := 0;
748
    FCounter := 0;
731
    Inc(MainForm.FScore, 1000);
749
    Inc(MainForm.FScore, 1000);
Line 769... Line 787...
769
    if FCounter>200 then Dead;
787
    if FCounter>200 then Dead;
770
  end;
788
  end;
771
  inc(FCounter, MoveCount);
789
  inc(FCounter, MoveCount);
772
end;
790
end;
773
 
791
 
774
procedure TEnemyUFO2.HitEnemy(Deaded: Boolean);
792
procedure TEnemyUFO2.HitEnemy(ADead: Boolean);
775
begin
793
begin
776
  if Deaded then
794
  if ADead then
777
  begin
795
  begin
778
    MainForm.PlaySound('Explosion', False);
796
    MainForm.PlaySound('Explosion', False);
779
    FMode := 2;
797
    FMode := 2;
780
    FCounter := 0;
798
    FCounter := 0;
781
    Inc(MainForm.FScore, 1000);
799
    Inc(MainForm.FScore, 1000);
Line 800... Line 818...
800
  Width := Image.Width;
818
  Width := Image.Width;
801
  Height := Image.Height;
819
  Height := Image.Height;
802
  AnimCount := Image.PatternCount;
820
  AnimCount := Image.PatternCount;
803
  AnimLooped := True;
821
  AnimLooped := True;
804
  AnimSpeed := 15/1000;
822
  AnimSpeed := 15/1000;
805
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
823
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
806
end;
824
end;
807
 
825
 
808
procedure TEnemyUFO.DoMove(MoveCount: Integer);
826
procedure TEnemyUFO.DoMove(MoveCount: Integer);
809
begin
827
begin
810
  inherited DoMove(MoveCount);
828
  inherited DoMove(MoveCount);
Line 829... Line 847...
829
  Height := Image.Height;
847
  Height := Image.Height;
830
  AnimCount := Image.PatternCount;
848
  AnimCount := Image.PatternCount;
831
  AnimLooped := True;
849
  AnimLooped := True;
832
  AnimSpeed := 15/1000;
850
  AnimSpeed := 15/1000;
833
  PixelCheck := True;
851
  PixelCheck := True;
834
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
852
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
835
end;
853
end;
836
 
854
 
837
procedure TEnemyAttacker.HitEnemy(Deaded: Boolean);
855
procedure TEnemyAttacker.HitEnemy(ADead: Boolean);
838
begin
856
begin
839
  if Deaded then
857
  if ADead then
840
  begin
858
  begin
841
    MainForm.PlaySound('Explosion', False);
859
    MainForm.PlaySound('Explosion', False);
842
    FMode := 2;
860
    FMode := 2;
843
    FCounter := 0;
861
    FCounter := 0;
844
    Inc(MainForm.FScore, 1000);
862
    Inc(MainForm.FScore, 1000);
Line 882... Line 900...
882
  AnimCount := Image.PatternCount;
900
  AnimCount := Image.PatternCount;
883
  AnimLooped := True;
901
  AnimLooped := True;
884
  AnimSpeed := 15/1000;
902
  AnimSpeed := 15/1000;
885
  PixelCheck := True;
903
  PixelCheck := True;
886
  Collisioned := False;
904
  Collisioned := False;
887
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
905
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
888
  MainForm.FBossLife := FLife;
906
  MainForm.FBossLife := FLife;
889
  waiter1 := 0;
907
  waiter1 := 0;
890
  waiter2 := 0;
908
  waiter2 := 0;
891
end;
909
end;
892
 
910
 
893
procedure TEnemyBoss.HitEnemy(Deaded: Boolean);
911
procedure TEnemyBoss.HitEnemy(ADead: Boolean);
894
begin
912
begin
895
  if Deaded then
913
  if ADead then
896
  begin
914
  begin
897
    MainForm.PlaySound('Explosion', False);
915
    MainForm.PlaySound('Explosion', False);
898
    FMode := 2;
916
    FMode := 2;
899
    FCounter := 0;
917
    FCounter := 0;
900
    Inc(MainForm.FScore, 100000);
918
    Inc(MainForm.FScore, 100000);
Line 988... Line 1006...
988
  Height := Image.Height;
1006
  Height := Image.Height;
989
  AnimCount := Image.PatternCount;
1007
  AnimCount := Image.PatternCount;
990
  AnimLooped := True;
1008
  AnimLooped := True;
991
  AnimSpeed := 15/1000;
1009
  AnimSpeed := 15/1000;
992
  PixelCheck := True;
1010
  PixelCheck := True;
993
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
1011
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
994
end;
1012
end;
995
 
1013
 
996
procedure TEnemyAttacker2.HitEnemy(Deaded: Boolean);
1014
procedure TEnemyAttacker2.HitEnemy(ADead: Boolean);
997
begin
1015
begin
998
  if Deaded then
1016
  if ADead then
999
  begin
1017
  begin
1000
    MainForm.PlaySound('Explosion', False);
1018
    MainForm.PlaySound('Explosion', False);
1001
    FMode := 2;
1019
    FMode := 2;
1002
    FCounter := 0;
1020
    FCounter := 0;
1003
    Inc(MainForm.FScore, 5000);
1021
    Inc(MainForm.FScore, 5000);
Line 1063... Line 1081...
1063
    if FCounter>200 then Dead;
1081
    if FCounter>200 then Dead;
1064
  end;
1082
  end;
1065
  inc(FCounter, MoveCount);
1083
  inc(FCounter, MoveCount);
1066
end;
1084
end;
1067
 
1085
 
1068
procedure TEnemyAttacker3.HitEnemy(Deaded: Boolean);
1086
procedure TEnemyAttacker3.HitEnemy(ADead: Boolean);
1069
begin
1087
begin
1070
  if Deaded then
1088
  if ADead then
1071
  begin
1089
  begin
1072
    MainForm.PlaySound('Explosion', False);
1090
    MainForm.PlaySound('Explosion', False);
1073
    FMode := 1;
1091
    FMode := 1;
1074
    FCounter := 0;
1092
    FCounter := 0;
1075
    Inc(MainForm.FScore, 5000);
1093
    Inc(MainForm.FScore, 5000);
Line 1121... Line 1139...
1121
  Height := Image.Height;
1139
  Height := Image.Height;
1122
  AnimCount := Image.PatternCount;
1140
  AnimCount := Image.PatternCount;
1123
  AnimLooped := True;
1141
  AnimLooped := True;
1124
  AnimSpeed := 15/1000;
1142
  AnimSpeed := 15/1000;
1125
  PixelCheck := True;
1143
  PixelCheck := True;
1126
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].l;
1144
  FLife := EnemyAdventTable[mainform.FEnemyAdventPos].lifes;
1127
end;
1145
end;
1128
 
1146
 
1129
function TMainForm.SoundKarte: boolean;
1147
function TMainForm.SoundKarte: boolean;
1130
begin
1148
begin
1131
  result := WaveOutGetNumDevs > 0;
1149
  result := WaveOutGetNumDevs > 0;
Line 1133... Line 1151...
1133
 
1151
 
1134
procedure TMainForm.FormCreate(Sender: TObject);
1152
procedure TMainForm.FormCreate(Sender: TObject);
1135
var
1153
var
1136
  Ergebnis: string;
1154
  Ergebnis: string;
1137
  daten: textfile;
1155
  daten: textfile;
1138
  i: integer;
-
 
1139
  punkt: integer;
-
 
1140
  ok: boolean;
1156
  ok: boolean;
1141
begin
1157
begin
1142
  { Beginne VCL-Ersatz }
1158
  { Beginne VCL-Ersatz }
1143
  versioninfo := tpjversioninfo.Create(self);
-
 
1144
 
-
 
1145
  dxtimer := tdxtimer.Create(self);
1159
  dxtimer := tdxtimer.Create(self);
1146
  dxtimer.Interval := 33;
1160
  dxtimer.Interval := 33;
1147
  dxtimer.OnActivate := DXTimerActivate;
1161
  dxtimer.OnActivate := DXTimerActivate;
1148
  dxtimer.OnDeactivate := DXTimerDeactivate;
1162
  dxtimer.OnDeactivate := DXTimerDeactivate;
1149
  dxtimer.OnTimer := DXTimerTimer;
1163
  dxtimer.OnTimer := DXTimerTimer;
Line 1189... Line 1203...
1189
  spriteengine := tdxspriteengine.create(self);
1203
  spriteengine := tdxspriteengine.create(self);
1190
  spriteengine.DXDraw := dxdraw;
1204
  spriteengine.DXDraw := dxdraw;
1191
 
1205
 
1192
  { Ende VCL-Ersatz }
1206
  { Ende VCL-Ersatz }
1193
 
1207
 
1194
  punkt := 0;
-
 
1195
  FDirectory := extractfilepath(paramstr(0));
-
 
1196
  versioninfo.filename := paramstr(0);
-
 
1197
  for i := 1 to length(versioninfo.ProductVersion) do
-
 
1198
  begin
-
 
1199
    if copy(versioninfo.ProductVersion, i, 1) = '.' then inc(punkt);
-
 
1200
    if punkt < 2 then fengineversion := fengineversion+copy(versioninfo.ProductVersion, i, 1);
-
 
1201
  end;
-
 
1202
  Application.Title := 'SpaceMission '+FEngineVersion;
1208
  Application.Title := 'SpaceMission '+ProgramVersion;
1203
  LoadOptions;
1209
  LoadOptions;
1204
  DXInit;
1210
  DXInit;
1205
  SoundInit;
1211
  SoundInit;
1206
  MusicInit;
1212
  MusicInit;
1207
  DeleteArray;
1213
  DeleteArray;
Line 1209... Line 1215...
1209
  begin
1215
  begin
1210
    AssignFile(daten, paramstr(1));
1216
    AssignFile(daten, paramstr(1));
1211
    Reset(daten);
1217
    Reset(daten);
1212
    ok := true;
1218
    ok := true;
1213
    ReadLN(daten, Ergebnis);
1219
    ReadLN(daten, Ergebnis);
1214
    if Ergebnis <> '; SpaceMission '+mainform.FEngineVersion then ok := false;
1220
    if Ergebnis <> '; SpaceMission '+ProgramVersion then ok := false;
1215
    ReadLN(daten, Ergebnis);
1221
    ReadLN(daten, Ergebnis);
1216
    if ergebnis <> '; SAV-File' then ok := false;
1222
    if ergebnis <> '; SAV-File' then ok := false;
1217
    if not ok then
1223
    if not ok then
1218
    begin
1224
    begin
1219
      showmessage(FileError);
1225
      showmessage(FileError);
Line 1329... Line 1335...
1329
 
1335
 
1330
  InternetCloseHandle(hsession);
1336
  InternetCloseHandle(hsession);
1331
  Result := resStr;
1337
  Result := resStr;
1332
end;
1338
end;
1333
 
1339
 
1334
procedure TMainForm.AufUpdatesprfen1Click(Sender: TObject);
1340
procedure TMainForm.CheckUpdatesClick(Sender: TObject);
1335
var
1341
var
1336
  temp: string;
1342
  temp: string;
1337
begin
1343
begin
1338
  temp := GetHTML('http://www.viathinksoft.de/update/?id=spacemission');
1344
  temp := GetHTML('http://www.viathinksoft.de/update/?id=spacemission');
1339
  if copy(temp, 0, 7) = 'Status:' then
1345
  if copy(temp, 0, 7) = 'Status:' then
1340
  begin
1346
  begin
1341
    Application.MessageBox('Ein Fehler ist aufgetreten. Wahrscheinlich ist keine Internetverbindung aufgebaut, oder der der ViaThinkSoft-Server temporär offline.', 'Fehler', MB_OK + MB_ICONERROR)
1347
    Application.MessageBox('Ein Fehler ist aufgetreten. Wahrscheinlich ist keine Internetverbindung aufgebaut, oder der der ViaThinkSoft-Server temporär offline.', 'Fehler', MB_OK + MB_ICONERROR)
1342
  end
1348
  end
1343
  else
1349
  else
1344
  begin
1350
  begin
1345
    if GetHTML('http://www.viathinksoft.de/update/?id=spacemission') <> '1.1d' then
1351
    if GetHTML('http://www.viathinksoft.de/update/?id=spacemission') <> ProgramVersion then
1346
    begin
1352
    begin
1347
      if Application.MessageBox('Eine neue Programmversion ist vorhanden. Möchten Sie diese jetzt herunterladen?', 'Information', MB_YESNO + MB_ICONASTERISK) = ID_YES then
1353
      if Application.MessageBox('Eine neue Programmversion ist vorhanden. Möchten Sie diese jetzt herunterladen?', 'Information', MB_YESNO + MB_ICONASTERISK) = ID_YES then
1348
        shellexecute(application.handle, 'open', pchar('http://www.viathinksoft.de/update/?id=@spacemission'), '', '', sw_normal);
1354
        shellexecute(application.handle, 'open', pchar('http://www.viathinksoft.de/update/?id=@spacemission'), '', '', sw_normal);
1349
    end
1355
    end
1350
    else
1356
    else
Line 1466... Line 1472...
1466
procedure TMainForm.DXDrawFinalize(Sender: TObject);
1472
procedure TMainForm.DXDrawFinalize(Sender: TObject);
1467
begin
1473
begin
1468
  DXTimer.Enabled := False;
1474
  DXTimer.Enabled := False;
1469
end;
1475
end;
1470
 
1476
 
1471
var
-
 
1472
  ProgrammGestartet: boolean;
-
 
1473
 
-
 
1474
procedure TMainForm.DXTimerActivate(Sender: TObject);
1477
procedure TMainForm.DXTimerActivate(Sender: TObject);
1475
begin
1478
begin
1476
  Caption := Application.Title;
1479
  Caption := Application.Title;
1477
  if not ProgrammGestartet then
1480
  if not ProgrammGestartet then
1478
  begin
1481
  begin
Line 1555... Line 1558...
1555
  if OptionBreitbild.checked then INIDatei.WriteBool('Settings', 'ScreenAutoSize', true)
1558
  if OptionBreitbild.checked then INIDatei.WriteBool('Settings', 'ScreenAutoSize', true)
1556
    else INIDatei.WriteBool('Settings', 'ScreenAutoSize', false);
1559
    else INIDatei.WriteBool('Settings', 'ScreenAutoSize', false);
1557
  if FInterval = giLeicht then INIDatei.WriteInteger('Settings', 'Speed', 1);
1560
  if FInterval = giLeicht then INIDatei.WriteInteger('Settings', 'Speed', 1);
1558
  if FInterval = giMittel then INIDatei.WriteInteger('Settings', 'Speed', 2);
1561
  if FInterval = giMittel then INIDatei.WriteInteger('Settings', 'Speed', 2);
1559
  if FInterval = giSchwer then INIDatei.WriteInteger('Settings', 'Speed', 3);
1562
  if FInterval = giSchwer then INIDatei.WriteInteger('Settings', 'Speed', 3);
-
 
1563
  if FInterval = giMaster then INIDatei.WriteInteger('Settings', 'Speed', 4);
1560
  INIDatei.Free;
1564
  INIDatei.Free;
1561
end;
1565
end;
1562
 
1566
 
1563
procedure TMainForm.LoadOptions;
1567
procedure TMainForm.LoadOptions;
1564
var
1568
var
Line 1582... Line 1586...
1582
  if INIDatei.ReadInteger('Settings', 'Speed', 2) = 3 then
1586
  if INIDatei.ReadInteger('Settings', 'Speed', 2) = 3 then
1583
  begin
1587
  begin
1584
    FInterval := giSchwer;
1588
    FInterval := giSchwer;
1585
    Schwer.checked := true;
1589
    Schwer.checked := true;
1586
  end;
1590
  end;
-
 
1591
  if INIDatei.ReadInteger('Settings', 'Speed', 2) = 4 then
-
 
1592
  begin
-
 
1593
    FInterval := giMaster;
-
 
1594
    Master.checked := true;
-
 
1595
  end;
1587
  INIDatei.Free;
1596
  INIDatei.Free;
1588
  WriteOptions;
1597
  WriteOptions;
1589
end;
1598
end;
1590
 
1599
 
1591
procedure TMainForm.BlinkUpdate;
1600
procedure TMainForm.BlinkUpdate;
Line 1702... Line 1711...
1702
procedure TMainForm.StartSceneMain;
1711
procedure TMainForm.StartSceneMain;
1703
{var
1712
{var
1704
  i, j: Integer;}
1713
  i, j: Integer;}
1705
begin
1714
begin
1706
  sleep(500);
1715
  sleep(500);
1707
  SpielerFliegtFort := false;
-
 
1708
  FCounter := 0;
1716
  FCounter := 0;
1709
  NewLevel(FLevel);
1717
  NewLevel(FLevel);
1710
  BossExists := false;
1718
  BossExists := false;
1711
  PlayMusic(mtGame);
1719
  PlayMusic(mtGame);
1712
  FEnemyAdventPos := 1;
1720
  FEnemyAdventPos := 1;
1713
  FFrame := -4;
1721
  FFrame := -4;
1714
  TPlayerSprite.Create(SpriteEngine.Engine);
1722
  PlayerSprite := TPlayerSprite.Create(SpriteEngine.Engine);
1715
  with TBackground.Create(SpriteEngine.Engine) do
1723
  with TBackground.Create(SpriteEngine.Engine) do
1716
  begin
1724
  begin
1717
    SetMapSize(1, 1);
1725
    SetMapSize(1, 1);
1718
    Image := mainform.ImageList.Items.Find('Star3');
1726
    Image := mainform.ImageList.Items.Find('Star3');
1719
    Z := -13;
1727
    Z := -13;
Line 1852... Line 1860...
1852
 
1860
 
1853
procedure TMainForm.DeleteArray();
1861
procedure TMainForm.DeleteArray();
1854
var
1862
var
1855
  i: integer;
1863
  i: integer;
1856
begin
1864
begin
1857
  for i := 1 to 9999 do
1865
  for i := Low(EnemyAdventTable) to High(EnemyAdventTable) do
1858
  begin
1866
  begin
1859
    EnemyAdventTable[i].c := tnoting;
1867
    EnemyAdventTable[i].spriteClass := TNothing;
1860
    EnemyAdventTable[i].x := 0;
1868
    EnemyAdventTable[i].x := 0;
1861
    EnemyAdventTable[i].y := 0;
1869
    EnemyAdventTable[i].y := 0;
1862
    EnemyAdventTable[i].l := 0;
1870
    EnemyAdventTable[i].lifes := 0;
1863
  end;
1871
  end;
1864
  FRestEnemys := 0;
1872
  FRestEnemys := 0;
1865
end;
1873
end;
1866
 
1874
 
1867
var
-
 
1868
  levact: integer;
-
 
1869
 
-
 
1870
procedure TMainForm.NewLevel(lev: integer);
1875
procedure TMainForm.NewLevel(lev: integer);
-
 
1876
resourcestring
-
 
1877
  LNG_LEVEL_INVALID = 'Das Level Nr. %d ist ungültig!'+#13#10+'Das Programm wird beendet.';
1871
var
1878
var
1872
  act: integer;
1879
  act: integer;
1873
  filex: textfile;
1880
  filex: textfile;
1874
  ergebniss: string;
1881
  ergebniss: string;
1875
begin
1882
begin
Line 1905... Line 1912...
1905
    enemys[27] := TEnemyAttacker;
1912
    enemys[27] := TEnemyAttacker;
1906
    randomize;
1913
    randomize;
1907
    for act := 1 to lev*75-1 do
1914
    for act := 1 to lev*75-1 do
1908
    begin
1915
    begin
1909
      inc(FRestEnemys);
1916
      inc(FRestEnemys);
1910
      EnemyAdventTable[act].c := enemys[random(lev+2)+1];
1917
      EnemyAdventTable[act].spriteClass := enemys[random(lev+2)+1];
1911
      if EnemyAdventTable[act].c = TEnemyAttacker2 then EnemyAdventTable[act].c := enemys[random(lev+2)+1]; {O_o}
1918
      if EnemyAdventTable[act].spriteClass = TEnemyAttacker2 then EnemyAdventTable[act].spriteClass := enemys[random(lev+2)+1]; {O_o}
1912
      EnemyAdventTable[act].x := act*30 + random(85-(lev+(random(lev))*2)){O_o};
1919
      EnemyAdventTable[act].x := act*30 + random(85-(lev+(random(lev))*2)){O_o};
1913
      EnemyAdventTable[act].y := random(dxdraw.surfaceheight);
1920
      EnemyAdventTable[act].y := random(dxdraw.surfaceheight);
1914
      if (EnemyAdventTable[act].c <> TEnemyMeteor) and (EnemyAdventTable[act].c <> TEnemyAttacker2) then EnemyAdventTable[act].l := random(lev)+1;
1921
      if (EnemyAdventTable[act].spriteClass <> TEnemyMeteor) and (EnemyAdventTable[act].spriteClass <> TEnemyAttacker2) then EnemyAdventTable[act].lifes := random(lev)+1;
1915
      if EnemyAdventTable[act].c = TEnemyAttacker2 then EnemyAdventTable[act].l := random(6)+1{O_o};
1922
      if EnemyAdventTable[act].spriteClass = TEnemyAttacker2 then EnemyAdventTable[act].lifes := random(6)+1{O_o};
1916
    end;
1923
    end;
1917
    EnemyAdventTable[lev*75].c := TEnemyBoss;
1924
    EnemyAdventTable[lev*75].spriteClass := TEnemyBoss;
1918
    EnemyAdventTable[lev*75].x := lev*75*30{O_o} div lev;
1925
    EnemyAdventTable[lev*75].x := lev*75*30{O_o} div lev;
1919
    EnemyAdventTable[lev*75].y := (dxdraw.surfaceheight div 2) - (MainForm.ImageList.Items.Find('Enemy-boss').height div 2);
1926
    EnemyAdventTable[lev*75].y := (dxdraw.surfaceheight div 2) - (MainForm.ImageList.Items.Find('Enemy-boss').height div 2);
1920
    EnemyAdventTable[lev*75].l := lev*5;
1927
    EnemyAdventTable[lev*75].lifes := lev*5;
1921
    inc(FRestEnemys);
1928
    inc(FRestEnemys);
1922
  end
1929
  end
1923
  else
1930
  else
1924
  begin
1931
  begin
1925
    enemys[1] := TEnemyAttacker;
1932
    enemys[1] := TEnemyAttacker;
Line 1939... Line 1946...
1939
        if levact = 0 then
1946
        if levact = 0 then
1940
        begin
1947
        begin
1941
          readln(filex, ergebniss);
1948
          readln(filex, ergebniss);
1942
          if ergebniss <> '; SpaceMission '+FCompVersion then
1949
          if ergebniss <> '; SpaceMission '+FCompVersion then
1943
          begin
1950
          begin
1944
            showmessage('Das Level '+inttostr(lev)+' ist ungültig!'+#13#10+'Das Programm wird beendet.');
1951
            showmessage(Format(LNG_LEVEL_INVALID, [lev]));
1945
            application.terminate;
1952
            application.terminate;
1946
            exit;
1953
            exit;
1947
          end;
1954
          end;
1948
          readln(filex, ergebniss);
1955
          readln(filex, ergebniss);
1949
          if ergebniss <> '; LEV-File' then
1956
          if ergebniss <> '; LEV-File' then
1950
          begin
1957
          begin
1951
            showmessage('Das Level '+inttostr(lev)+' ist ungültig!'+#13#10+'Das Programm wird beendet.');
1958
            showmessage(Format(LNG_LEVEL_INVALID, [lev]));
1952
            application.terminate;
1959
            application.terminate;
1953
            exit;
1960
            exit;
1954
          end;
1961
          end;
1955
          readln(filex);
1962
          readln(filex);
1956
        end;
1963
        end;
Line 1959... Line 1966...
1959
        if levact = 5 then levact := 1;
1966
        if levact = 5 then levact := 1;
1960
        if levact = 1 then
1967
        if levact = 1 then
1961
        begin
1968
        begin
1962
          inc(pos[levact]);
1969
          inc(pos[levact]);
1963
          inc(FRestEnemys);
1970
          inc(FRestEnemys);
1964
          EnemyAdventTable[pos[levact]].c := enemys[strtoint(ergebniss)];
1971
          EnemyAdventTable[pos[levact]].spriteClass := enemys[strtoint(ergebniss)];
1965
        end;
1972
        end;
1966
        if levact = 2 then
1973
        if levact = 2 then
1967
        begin
1974
        begin
1968
          inc(pos[levact]);
1975
          inc(pos[levact]);
1969
          EnemyAdventTable[pos[levact]].x := strtoint(ergebniss);
1976
          EnemyAdventTable[pos[levact]].x := strtoint(ergebniss);
Line 1974... Line 1981...
1974
          EnemyAdventTable[pos[levact]].y := strtoint(ergebniss);
1981
          EnemyAdventTable[pos[levact]].y := strtoint(ergebniss);
1975
        end;
1982
        end;
1976
        if levact = 4 then
1983
        if levact = 4 then
1977
        begin
1984
        begin
1978
          inc(pos[levact]);
1985
          inc(pos[levact]);
1979
          EnemyAdventTable[pos[levact]].l := strtoint(ergebniss);
1986
          EnemyAdventTable[pos[levact]].lifes := strtoint(ergebniss);
1980
        end;
1987
        end;
1981
      end;
1988
      end;
1982
      closefile(filex);
1989
      closefile(filex);
1983
    end;
1990
    end;
1984
  end;
1991
  end;
Line 2025... Line 2032...
2025
      Textout((dxdraw.surfaceWidth div 2)-187, (dxdraw.surfaceheight div 2)-2, '>');
2032
      Textout((dxdraw.surfaceWidth div 2)-187, (dxdraw.surfaceheight div 2)-2, '>');
2026
      Font.Color := clRed;
2033
      Font.Color := clRed;
2027
      Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2), 'Zufallslevel');
2034
      Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2), 'Zufallslevel');
2028
      Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2), '>');
2035
      Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2), '>');
2029
    end;
2036
    end;
2030
    if (FBlink div 300) mod 2=0 then
2037
    { if (FBlink div 300) mod 2=0 then
2031
    begin
2038
    begin
2032
      Font.Color := clGreen;
2039
      Font.Color := clGreen;
2033
      Textout((dxdraw.surfaceWidth div 2)-187, dxdraw.surfaceheight-117, 'Weiter mit Leertaste');
2040
      Textout((dxdraw.surfaceWidth div 2)-187, dxdraw.surfaceheight-117, 'Weiter mit Leertaste');
2034
      Font.Color := clLime;
2041
      Font.Color := clLime;
2035
      Textout((dxdraw.surfaceWidth div 2)-185, dxdraw.surfaceheight-115, 'Weiter mit Leertaste');
2042
      Textout((dxdraw.surfaceWidth div 2)-185, dxdraw.surfaceheight-115, 'Weiter mit Leertaste');
2036
    end;
2043
    end; }
2037
    BlinkUpdate;
2044
    BlinkUpdate;
2038
    Release;
2045
    Release;
2039
  end;
2046
  end;
-
 
2047
  // Weiter mit Leertaste oder Enter
2040
  if isButton1 in DXInput.States then
2048
  if (isButton1 in DXInput.States) or (isButton2 in DXInput.States) then
2041
  begin
2049
  begin
2042
    FLevel := 1;
2050
    FLevel := 1;
2043
    if ((FMenuItem=1) and (fileexists(FDirectory+'Levels\Level '+inttostr(FLevel)+'.lev')=false)) or ((FMenuItem=2) and (FLevel > 20)) then
2051
    if ((FMenuItem=1) and (fileexists(FDirectory+'Levels\Level '+inttostr(FLevel)+'.lev')=false)) or ((FMenuItem=2) and (FLevel > 20)) then
2044
    begin
2052
    begin
2045
      //PlaySound('Frage', False);
2053
      //PlaySound('Frage', False);
Line 2058... Line 2066...
2058
  Enemy: TSprite;
2066
  Enemy: TSprite;
2059
begin
2067
begin
2060
  if FInterval = giLeicht then SpriteEngine.Move(conleicht);
2068
  if FInterval = giLeicht then SpriteEngine.Move(conleicht);
2061
  if FInterval = giMittel then SpriteEngine.Move(conmittel);
2069
  if FInterval = giMittel then SpriteEngine.Move(conmittel);
2062
  if FInterval = giSchwer then SpriteEngine.Move(conschwer);
2070
  if FInterval = giSchwer then SpriteEngine.Move(conschwer);
-
 
2071
  if FInterval = giMaster then SpriteEngine.Move(conmaster);
2063
  SpriteEngine.Dead;
2072
  SpriteEngine.Dead;
2064
  while (Low(EnemyAdventTable)<=FEnemyAdventPos) and
2073
  while (Low(EnemyAdventTable)<=FEnemyAdventPos) and
2065
    (FEnemyAdventPos<=High(EnemyAdventTable)) and
2074
    (FEnemyAdventPos<=High(EnemyAdventTable)) and
2066
    ((EnemyAdventTable[FEnemyAdventPos].x / 4)<=FFrame) and
2075
    ((EnemyAdventTable[FEnemyAdventPos].x / 4)<=FFrame) and
2067
    (FRestEnemys>0) do
2076
    (FRestEnemys>0) do
2068
  begin
2077
  begin
2069
    if EnemyAdventTable[FEnemyAdventPos].c <> TNoting then
2078
    if EnemyAdventTable[FEnemyAdventPos].spriteClass <> TNothing then
2070
    begin
2079
    begin
2071
      with EnemyAdventTable[FEnemyAdventPos] do
2080
      with EnemyAdventTable[FEnemyAdventPos] do
2072
      begin
2081
      begin
2073
        Enemy := c.Create(SpriteEngine.Engine);
2082
        Enemy := spriteClass.Create(SpriteEngine.Engine);
2074
        Enemy.x := dxdraw.surfacewidth;
2083
        Enemy.x := dxdraw.surfacewidth;
2075
        //Enemy.y := y;
2084
        //Enemy.y := y;
2076
        if y <> 0 then Enemy.y := dxdraw.surfaceheight / (480{maximale Bandbreite im alten Format} / y)
2085
        if y <> 0 then Enemy.y := dxdraw.surfaceheight / (480{maximale Bandbreite im alten Format} / y)
2077
          else Enemy.y := 0;
2086
          else Enemy.y := 0;
2078
      end;
2087
      end;
Line 2130... Line 2139...
2130
            Font.Color := clPurple;
2139
            Font.Color := clPurple;
2131
            Textout(449, 439, 'Einheiten: ' + IntToStr(RestlicheEinheiten));
2140
            Textout(449, 439, 'Einheiten: ' + IntToStr(RestlicheEinheiten));
2132
            Font.Color := clFuchsia;
2141
            Font.Color := clFuchsia;
2133
            Textout(450, 440, 'Einheiten: ' + IntToStr(RestlicheEinheiten));
2142
            Textout(450, 440, 'Einheiten: ' + IntToStr(RestlicheEinheiten));
2134
          end;}
2143
          end;}
2135
        if BossExists and (FBossLife>0) and (FRestEnemys>0) then
2144
        if BossExists and (FBossLife>0) then
-
 
2145
        begin
-
 
2146
          if (FRestEnemys>0) then
2136
        begin
2147
          begin
2137
          Font.Color := clGreen;
2148
            Font.Color := clGreen;
2138
          Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-81, 'Boss: ' + IntToStr(FBossLife));
2149
            Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-81, 'Boss: ' + IntToStr(FBossLife));
2139
          Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Einheiten: ' + IntToStr(FRestEnemys));
2150
            Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Einheiten: ' + IntToStr(FRestEnemys));
2140
          Font.Color := clLime;
2151
            Font.Color := clLime;
2141
          Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-80, 'Boss: ' + IntToStr(FBossLife));
2152
            Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-80, 'Boss: ' + IntToStr(FBossLife));
2142
          Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Einheiten: ' + IntToStr(FRestEnemys));
2153
            Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Einheiten: ' + IntToStr(FRestEnemys));
2143
        end;
2154
          end;
2144
        if BossExists and (FBossLife>0) and (FRestEnemys<1) then
2155
          if (FRestEnemys<1) then
2145
        begin
2156
          begin
2146
          Font.Color := clGreen;
2157
            Font.Color := clGreen;
2147
          Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Boss: ' + IntToStr(FBossLife));
2158
            Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Boss: ' + IntToStr(FBossLife));
2148
          Font.Color := clLime;
2159
            Font.Color := clLime;
2149
          Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Boss: ' + IntToStr(FBossLife));
2160
            Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Boss: ' + IntToStr(FBossLife));
2150
        end;
2161
          end;
-
 
2162
        end;
2151
        if (FRestEnemys>0) and (Bossexists=false) then
2163
        if (FRestEnemys>0) and not Bossexists then
2152
        begin
2164
        begin
2153
          Font.Color := clGreen;
2165
          Font.Color := clGreen;
2154
          Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Einheiten: ' + IntToStr(FRestEnemys));
2166
          Textout(dxdraw.surfacewidth-191, dxdraw.surfaceheight-41, 'Einheiten: ' + IntToStr(FRestEnemys));
2155
          Font.Color := clLime;
2167
          Font.Color := clLime;
2156
          Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Einheiten: ' + IntToStr(FRestEnemys));
2168
          Textout(dxdraw.surfacewidth-190, dxdraw.surfaceheight-40, 'Einheiten: ' + IntToStr(FRestEnemys));
Line 2158... Line 2170...
2158
        Release;
2170
        Release;
2159
      end;
2171
      end;
2160
    end
2172
    end
2161
    else
2173
    else
2162
    begin
2174
    begin
2163
      DXDraw.Surface.Canvas.Font.Color := clGreen;
2175
      DXDraw.Surface.Canvas.Font.Color := clGreen; // Grüne schrift bei gescheitert? FIXME
2164
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-251, dxdraw.surfaceheight-41, 'Mission gescheitert!');
2176
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-251, dxdraw.surfaceheight-41, 'Mission gescheitert!');
2165
      DXDraw.Surface.Canvas.Font.Color := clLime;
2177
      DXDraw.Surface.Canvas.Font.Color := clLime;
2166
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-250, dxdraw.surfaceheight-40, 'Mission gescheitert!');
2178
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-250, dxdraw.surfaceheight-40, 'Mission gescheitert!');
2167
      DXDraw.Surface.Canvas.Release;
2179
      DXDraw.Surface.Canvas.Release;
2168
    end;
2180
    end;
2169
    if FRestEnemys<0 then FRestEnemys := 0; //Muss das sein?
2181
    if FRestEnemys<0 then FRestEnemys := 0; //Muss das sein?
2170
    if (Ec=0) and (FRestEnemys=0){ and (SpielerFliegtFort = false)} then
2182
    if (Ec=0) and (FRestEnemys=0){ and (SpielerFliegtFort = false)}
-
 
2183
    and ((BossExists and (FBossLife=0)) or not BossExists) then
2171
    begin
2184
    begin
2172
      DXDraw.Surface.Canvas.Font.Color := clGreen;
2185
      DXDraw.Surface.Canvas.Font.Color := clGreen;
2173
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-251, dxdraw.surfaceheight-41, 'Mission erfolgreich!');
2186
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-251, dxdraw.surfaceheight-41, 'Mission erfolgreich!');
2174
      DXDraw.Surface.Canvas.Font.Color := clLime;
2187
      DXDraw.Surface.Canvas.Font.Color := clLime;
2175
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-250, dxdraw.surfaceheight-40, 'Mission erfolgreich!');
2188
      DXDraw.Surface.Canvas.Textout(dxdraw.surfacewidth-250, dxdraw.surfaceheight-40, 'Mission erfolgreich!');
2176
      DXDraw.Surface.Canvas.Release;
2189
      DXDraw.Surface.Canvas.Release;
2177
      Sleep(1);
2190
      Sleep(1);
2178
      inc(FCounter);
2191
      inc(FCounter);
2179
      if FCounter>150{200} then SpielerFliegtFort := true;
2192
      if FCounter>150{200} then PlayerSprite.FlyAway;
2180
    end;
2193
    end;
2181
  end;
2194
  end;
2182
end;
2195
end;
2183
 
2196
 
2184
procedure TMainForm.SceneGameOver;
2197
procedure TMainForm.SceneGameOver;
Line 2310... Line 2323...
2310
end;
2323
end;
2311
 
2324
 
2312
procedure TMainForm.OptionMusicClick(Sender: TObject);
2325
procedure TMainForm.OptionMusicClick(Sender: TObject);
2313
begin
2326
begin
2314
  OptionMusic.Checked := not OptionMusic.Checked;
2327
  OptionMusic.Checked := not OptionMusic.Checked;
2315
  if OptionMusic.Checked then PlayMusic(FMusic)
2328
  if OptionMusic.Checked then
-
 
2329
  begin
-
 
2330
    PlayMusic(FMusic)
-
 
2331
  end
-
 
2332
  else
-
 
2333
  begin
2316
    else DestroyMusic(FMusic);
2334
    DestroyMusic(FMusic);
-
 
2335
  end;
2317
  WriteOptions;
2336
  WriteOptions;
2318
end;
2337
end;
2319
 
2338
 
2320
procedure TMainForm.MitarbeiterClick(Sender: TObject);
2339
procedure TMainForm.MasterClick(Sender: TObject);
2321
begin
2340
begin
-
 
2341
  master.checked := true;
-
 
2342
  FInterval := giMaster;
-
 
2343
  writeoptions;
-
 
2344
end;
-
 
2345
 
-
 
2346
procedure TMainForm.MitarbeiterClick(Sender: TObject);
-
 
2347
resourcestring
-
 
2348
  LNG_NOTFOUND = 'Die Datei "Texte\Mitwirkende.txt" ist nicht mehr vorhanden. Die Aktion wird abgebrochen!';
-
 
2349
const
2322
  if not fileexists(mainform.fdirectory+'Texte\Mitwirkende.txt') then
2350
  MitwirkendeTxt = 'Texte\Mitwirkende.txt';
2323
  begin
2351
begin
2324
    MessageDLG('Die Datei "Texte\Mitwirkende.txt" ist nicht mehr vorhanden. Die Aktion wird abgebrochen!',
2352
  if not fileexists(fdirectory+MitwirkendeTxt) then
2325
      mtWarning, [mbOK], 0);
-
 
2326
  end
-
 
2327
  else
-
 
2328
  begin
2353
  begin
2329
    TextForm.memo1.lines.loadfromfile(mainform.FDirectory+'Texte\Mitwirkende.txt');
2354
    MessageDLG(Format(LNG_NOTFOUND, [MitwirkendeTxt]), mtWarning, [mbOK], 0);
2330
    TextForm.showmodal;
2355
    Exit;
2331
  end;
2356
  end;
-
 
2357
 
-
 
2358
  TextForm.memo1.lines.loadfromfile(FDirectory+MitwirkendeTxt);
-
 
2359
  TextForm.ShowModal;
2332
end;
2360
end;
2333
 
2361
 
2334
procedure TEnemyMeteor.DoMove(MoveCount: Integer);
2362
procedure TEnemyMeteor.DoMove(MoveCount: Integer);
2335
begin
2363
begin
2336
  X := X - MoveCount*(250/1000);
2364
  X := X - MoveCount*(250/1000);
2337
  if X < -Width then Dead;
2365
  if X < -Width then Dead;
2338
end;
2366
end;
2339
 
2367
 
2340
procedure TEnemyMeteor.HitEnemy(Deaded: Boolean);
2368
procedure TEnemyMeteor.HitEnemy(ADead: Boolean);
2341
begin
2369
begin
2342
  if deaded then Collisioned := True;
2370
  if ADead then Collisioned := True;
2343
  MainForm.PlaySound('Hit', False);
2371
  MainForm.PlaySound('Hit', False);
2344
end;
2372
end;
2345
 
2373
 
2346
{procedure TMainForm.StopMusic;
2374
{procedure TMainForm.StopMusic;
2347
begin
2375
begin
Line 2429... Line 2457...
2429
  dxtimer.ActiveOnly := true;
2457
  dxtimer.ActiveOnly := true;
2430
end;
2458
end;
2431
 
2459
 
2432
procedure TMainForm.InformationenClick(Sender: TObject);
2460
procedure TMainForm.InformationenClick(Sender: TObject);
2433
begin
2461
begin
-
 
2462
  dxtimer.enabled := false;
2434
  InfoForm.showmodal;
2463
  InfoForm.showmodal;
-
 
2464
  if not mainform.gamepause.checked then mainform.dxtimer.enabled := true;
2435
end;
2465
end;
2436
 
2466
 
2437
procedure TMainForm.CheatClick(Sender: TObject);
2467
procedure TMainForm.CheatClick(Sender: TObject);
2438
begin
2468
begin
2439
  CheatForm.showmodal;
2469
  CheatForm.showmodal;
Line 2448... Line 2478...
2448
  DXTimer.Enabled := False;
2478
  DXTimer.Enabled := False;
2449
end;
2479
end;
2450
 
2480
 
2451
procedure TMainForm.FormDestroy(Sender: TObject);
2481
procedure TMainForm.FormDestroy(Sender: TObject);
2452
begin
2482
begin
2453
  versioninfo.free;
-
 
2454
  imagelist.free;
2483
  imagelist.free;
2455
  spriteengine.free;
2484
  spriteengine.free;
2456
  dxdraw.Free;
2485
  dxdraw.Free;
2457
  wavelist.free;
2486
  wavelist.free;
2458
  dxsound.free;
2487
  dxsound.free;