-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invader.h
118 lines (95 loc) · 2.79 KB
/
Invader.h
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
// I N C L U D E S /////////////////////////////////////////////////////////////
#ifndef InvaderH
#define InvaderH
#include <vcl\Forms.hpp>
#include <vcl\Menus.hpp>
#include <vcl\MPlayer.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\ExtCtrls.hpp>
// C O N S T
const int G_H = 420;
const int G_W = 400;
const int G_BAD_MAX = 48;
const int G_SHOT_MAX = 3;
const int G_STAR_MAX = 96;
enum PT_state {STOP , PLAY , PAUSE , ANI};
enum PT_life {ALIVE , DEAD , DYING , OFF};
struct PT_point
{
int x , y;
};
// C L A S S ///////////////////////////////////////////////////////////////////
class TFinvade: public TForm
{
__published:
TTimer *Time;
TImage *Welcome;
TMediaPlayer *Midi;
TMediaPlayer *Wav;
TImageList *bad;
TImageList *ship;
TImageList *shoot;
TImageList *flame;
TImageList *boom;
TImageList *weap;
TMainMenu *mMenu;
TMenuItem *mFile;
TMenuItem *mHelp;
TMenuItem *mAbout;
TMenuItem *mHowto;
TMenuItem *mL3;
TMenuItem *mExit;
TMenuItem *mL2;
TMenuItem *mNew;
TMenuItem *mPause;
TMenuItem *mOptions;
TMenuItem *mStop;
TMenuItem *mScores;
TMenuItem *mL1;
void __fastcall Rep(TObject *Sender);
void __fastcall Unp(TObject *Sender);
void __fastcall Exit(TObject *Sender);
void __fastcall Leak(TObject *Sender);
void __fastcall Setup(TObject *Sender);
void __fastcall WinLoop(TObject *Sender);
void __fastcall LoseLoop(TObject *Sender);
void __fastcall NewGame(TObject *Sender);
void __fastcall StopGame(TObject *Sender);
void __fastcall ShowAbout(TObject *Sender);
void __fastcall NextFrame(TObject *Sender);
void __fastcall ShowOptions(TObject *Sender);
void __fastcall ReadyClose(TObject *Sender, bool &CanClose);
void __fastcall UserHitKey(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall UserLetKey(TObject *Sender, WORD &Key, TShiftState Shift);
private:
PT_state Gstate;
TColor lookup[15];
PT_point stars[G_STAR_MAX];
PT_object *pship;
PT_object *pshot[G_SHOT_MAX];
PT_object *badie[G_BAD_MAX];
PT_object *bshot[G_BAD_MAX];
PT_object *bg;
PT_object *pause;
PT_object *planet;
PT_object *blocks;
Graphics::TBitmap *buffer;
bool drop,music,sound,speedflag,dropflag,PG_bg;
int dir,speed,shipart,counts,loopwait,numbad,numstars,gamespeed,diff,starflag,moveflag,backboom,dropcount;
bool pShooting;
bool pShootlock;
bool pCanshoot;
bool pBursting;
int pLastshot , pNextshot;
int GGX,GGY;
void __fastcall Start();
void __fastcall Score();
void __fastcall Over(bool);
public:
__fastcall TFinvade(TComponent *Owner);
friend class TFoptions;
};
extern TFinvade *Finvade;
#endif