GameBearShootWindow.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __GAME_BEARSHOOT_WINDOW_H__
  21. #define __GAME_BEARSHOOT_WINDOW_H__
  22. class idGameBearShootWindow;
  23. class BSEntity {
  24. public:
  25. const idMaterial * material;
  26. idStr materialName;
  27. float width, height;
  28. bool visible;
  29. idVec4 entColor;
  30. idVec2 position;
  31. float rotation;
  32. float rotationSpeed;
  33. idVec2 velocity;
  34. bool fadeIn;
  35. bool fadeOut;
  36. idGameBearShootWindow * game;
  37. public:
  38. BSEntity(idGameBearShootWindow* _game);
  39. virtual ~BSEntity();
  40. virtual void WriteToSaveGame( idFile *savefile );
  41. virtual void ReadFromSaveGame( idFile *savefile, idGameBearShootWindow* _game );
  42. void SetMaterial(const char* name);
  43. void SetSize( float _width, float _height );
  44. void SetVisible( bool isVisible );
  45. virtual void Update( float timeslice );
  46. virtual void Draw();
  47. private:
  48. };
  49. class idGameBearShootWindow : public idWindow {
  50. public:
  51. idGameBearShootWindow(idUserInterfaceLocal *gui);
  52. ~idGameBearShootWindow();
  53. virtual void WriteToSaveGame( idFile *savefile );
  54. virtual void ReadFromSaveGame( idFile *savefile );
  55. virtual const char* HandleEvent(const sysEvent_t *event, bool *updateVisuals);
  56. virtual void PostParse();
  57. virtual void Draw(int time, float x, float y);
  58. virtual const char* Activate(bool activate);
  59. virtual idWinVar * GetWinVarByName (const char *_name, bool winLookup = false, drawWin_t** owner = NULL);
  60. private:
  61. void CommonInit();
  62. void ResetGameState();
  63. void UpdateBear();
  64. void UpdateHelicopter();
  65. void UpdateTurret();
  66. void UpdateButtons();
  67. void UpdateGame();
  68. void UpdateScore();
  69. virtual bool ParseInternalVar(const char *name, idTokenParser *src);
  70. private:
  71. idWinBool gamerunning;
  72. idWinBool onFire;
  73. idWinBool onContinue;
  74. idWinBool onNewGame;
  75. float timeSlice;
  76. float timeRemaining;
  77. bool gameOver;
  78. int currentLevel;
  79. int goalsHit;
  80. bool updateScore;
  81. bool bearHitTarget;
  82. float bearScale;
  83. bool bearIsShrinking;
  84. int bearShrinkStartTime;
  85. float turretAngle;
  86. float turretForce;
  87. float windForce;
  88. int windUpdateTime;
  89. idList<BSEntity*> entities;
  90. BSEntity *turret;
  91. BSEntity *bear;
  92. BSEntity *helicopter;
  93. BSEntity *goal;
  94. BSEntity *wind;
  95. BSEntity *gunblast;
  96. };
  97. #endif //__GAME_BEARSHOOT_WINDOW_H__