home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / SWATMAIN.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  3KB  |  76 lines

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