[12210] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Fabian 'x3n' Landau |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | @file OrxoBlox.h |
---|
| 31 | @brief Declaration of the OrxoBlox class. |
---|
| 32 | @ingroup OrxoBlox |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _OrxoBlox_H__ |
---|
| 36 | #define _OrxoBlox_H__ |
---|
| 37 | |
---|
| 38 | #include "OrxoBlox/OrxoBloxPrereqs.h" |
---|
| 39 | |
---|
| 40 | #include "tools/Timer.h" |
---|
| 41 | |
---|
| 42 | #include "gametypes/Deathmatch.h" |
---|
[12212] | 43 | #include "OrxoBloxCenterpoint.h" |
---|
[12288] | 44 | #include "OrxoBloxWall.h" |
---|
[12337] | 45 | #include "OrxoBloxShip.h" |
---|
[12210] | 46 | |
---|
| 47 | namespace orxonox |
---|
| 48 | { |
---|
| 49 | |
---|
| 50 | /** |
---|
| 51 | @brief |
---|
[12212] | 52 | Implements a OrxoBlox minigame (<a href="http://en.wikipedia.org/wiki/OrxoBlox">Wikipedia::OrxoBlox</a>). |
---|
| 53 | It connects the different entities present in a game of OrxoBlox. |
---|
[12210] | 54 | |
---|
[12212] | 55 | - The @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint" is the playing field for the OrxoBlox minigame, it allows for configuration of the minigame, e.g. by setting the size of the playing field, or the length of the @ref orxonox::OrxoBloxBat "OrxoBloxBats". The playing field is always in the x,y-plane, the x-axis being the horizontal and the z-axis being the vertical axis.<br /> |
---|
| 56 | The OrxoBlox class redistributes the important parameters defined in @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint" to the other entities, that need to know them, e.g. the @ref orxonox::OrxoBloxBall "OrxoBloxBall" and the @ref orxonox::OrxoBloxBat "OrxoBloxBats".<br /> |
---|
| 57 | The @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>OrxoBlox</em>. |
---|
| 58 | - The @ref orxonox::OrxoBloxBall "OrxoBloxBall" is the ball both players play with. The @ref orxonox::OrxoBloxBall "OrxoBloxBall" both implements the movement of the ball, as well as the influence of the boundaries and consequently, also the bouncing (off the upper and lower delimiters, and as off the @ref orxonox::OrxoBloxBat "OrxoBloxBats") of the ball and the effects of the failure of a player to catch the ball (i.e. the scoring of the other player). |
---|
| 59 | - The two @ref orxonox::OrxoBloxBat "OrxoBloxBats" are the entities through which the players can actively participate in the game, by controlling them. The @ref orxonox::OrxoBloxBat "OrxoBloxBat" class manages the movement (and restrictions thereof) and the influence of the players on the bats. |
---|
[12210] | 60 | |
---|
| 61 | @author |
---|
| 62 | Fabian 'x3n' Landau |
---|
| 63 | |
---|
[12212] | 64 | @ingroup OrxoBlox |
---|
[12210] | 65 | */ |
---|
[12212] | 66 | class _OrxoBloxExport OrxoBlox : public Deathmatch |
---|
[12210] | 67 | { |
---|
| 68 | public: |
---|
[12212] | 69 | OrxoBlox(Context* context); //!< Constructor. Registers and initializes the object. |
---|
| 70 | virtual ~OrxoBlox(); //!< Destructor. Cleans up, if initialized. |
---|
[12210] | 71 | |
---|
[12212] | 72 | virtual void start() override; //!< Starts the OrxoBlox minigame. |
---|
| 73 | virtual void end() override; ///!< Ends the OrxoBlox minigame. |
---|
[12210] | 74 | |
---|
[12359] | 75 | PlayerInfo* getPlayer(); |
---|
[12367] | 76 | // void spawnPlayer(PlayerInfo* Player) override; |
---|
| 77 | virtual void playerPreSpawn(PlayerInfo* player) override; |
---|
[12391] | 78 | virtual void tick(float dt) override; |
---|
[12210] | 79 | |
---|
[12331] | 80 | void LevelUp(); |
---|
| 81 | |
---|
[12210] | 82 | /** |
---|
[12212] | 83 | @brief Set the OrxoBloxCenterpoint (the playing field). |
---|
| 84 | @param center A pointer to the OrxoBloxCenterpoint to be set. |
---|
[12210] | 85 | */ |
---|
[12212] | 86 | void setCenterpoint(OrxoBloxCenterpoint* center) |
---|
[12210] | 87 | { this->center_ = center; } |
---|
| 88 | |
---|
[12307] | 89 | OrxoBloxCenterpoint* getCenterpoint(void) |
---|
| 90 | { return this->center_; } |
---|
[12371] | 91 | //OrxoBloxStones* CheckForCollision(OrxoBloxBall* Ball); |
---|
[12370] | 92 | virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command |
---|
[12394] | 93 | void count(); |
---|
[12210] | 94 | protected: |
---|
[12307] | 95 | private: |
---|
| 96 | void startWall(void); |
---|
| 97 | void createWall(void); |
---|
[12371] | 98 | //void startBall(); //!< Starts the ball with some default speed. |
---|
[12210] | 99 | void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats. |
---|
| 100 | |
---|
[12212] | 101 | WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field. |
---|
[12371] | 102 | //WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball. |
---|
[12337] | 103 | unsigned int level_; |
---|
[12343] | 104 | |
---|
[12337] | 105 | WeakPtr<OrxoBloxShip> playership; |
---|
[12307] | 106 | PlayerInfo* player_; |
---|
[12210] | 107 | Timer starttimer_; //!< A timer to delay the start of the game. |
---|
[12307] | 108 | |
---|
[12280] | 109 | WeakPtr<OrxoBloxWall> futureWall_; |
---|
[12343] | 110 | std::vector<OrxoBloxWall*> activeWalls_; |
---|
[12394] | 111 | std::vector<OrxoBloxStones*> stones_; //!< A list of all stones in play. |
---|
| 112 | int counter; |
---|
| 113 | const int max_counter = 10; |
---|
[12343] | 114 | |
---|
[12210] | 115 | }; |
---|
| 116 | } |
---|
| 117 | |
---|
[12212] | 118 | #endif /* _OrxoBlox_H__ */ |
---|