home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / SWATMAIN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-10  |  2.4 KB  |  80 lines

  1. //---------------------------------------------------------------------------
  2. #ifndef swatH
  3. #define swatH
  4. //---------------------------------------------------------------------------
  5. #include <Forms.hpp>
  6. #include <ExtCtrls.hpp>
  7. #include <Controls.hpp>
  8. #include <Classes.hpp>
  9. #include <Menus.hpp>
  10. #include <StdCtrls.hpp>
  11. //---------------------------------------------------------------------------
  12. //
  13. //
  14. //
  15. TPoint Holes[5] = {
  16.   { 10, 10 }, { 200, 10 }, { 100, 100 }, { 10, 200 }, { 200, 200 }
  17. };
  18.  
  19. //
  20. //
  21. //
  22. struct THole {
  23.   int  Time;
  24.   bool Dead;
  25. };
  26.  
  27. class TSwatForm : public TForm
  28. {
  29. __published:
  30.     TImage *Image1;
  31.     TMainMenu *MainMenu1;
  32.     TMenuItem *Gamr1;
  33.     TMenuItem *New1;
  34.     TMenuItem *Options1;
  35.     TMenuItem *Stop1;
  36.     TMenuItem *Pause1;
  37.     TMenuItem *About1;
  38.     TTimer *Timer1;
  39.     TImage *GameOverImage;
  40.     TLabel *TimeLabel;
  41.     TLabel *MissLabel;
  42.     TLabel *HitsLabel;
  43.     TLabel *EscapedLabel;
  44.     TLabel *ScoreLabel;
  45.     void __fastcall FormCreate(TObject *Sender);
  46.     void __fastcall TimerTick(TObject *Sender);
  47.     void __fastcall DisplayAbout(TObject *Sender);
  48.     void __fastcall New1Click(TObject *Sender);
  49.     void __fastcall Stop1Click(TObject *Sender);
  50.     void __fastcall Pause1Click(TObject *Sender);
  51.     void __fastcall MouseDown(TObject *Sender, TMouseButton Button,
  52.       TShiftState Shift, Integer X, Integer Y);
  53.     void __fastcall Options1Click(TObject *Sender);
  54.     void __fastcall MouseUp(TObject *Sender, TMouseButton Button,
  55.       TShiftState Shift, Integer X, Integer Y);
  56.     void __fastcall WriteScore(void);
  57. private:        // private user declarations
  58.     int         Score, LiveTime, Frequence, GameTime;
  59.     int         Hits, Miss, Escaped;
  60.     bool        IsGameOver, IsPause;
  61.     Graphics::TBitmap*    Live;
  62.     Graphics::TBitmap*    Dead;
  63.     THole       HoleInfo[5];
  64. public:         // public user declarations
  65.     virtual __fastcall TSwatForm(TComponent* Owner);
  66. friend class TOptionsDlg;
  67. };
  68. //---------------------------------------------------------------------------
  69. extern TSwatForm *SwatForm;
  70. //---------------------------------------------------------------------------
  71. const int crMaletUp    = 5;
  72. const int crMaletDown  = 6;
  73.  
  74. const int MissedPoints  = -2;
  75. const int HitPoints     = 5;
  76. const int MissedCritter = -1;
  77. const int CritterSize   = 72;
  78. const int TimerId       = 1;
  79. #endif
  80.