Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h @ 12402

Last change on this file since 12402 was 12400, checked in by jeromela, 6 years ago

Changed counter

File size: 3.8 KB
RevLine 
[12210]1#ifndef _OrxoBlox_H__
2#define _OrxoBlox_H__
3
4#include "OrxoBlox/OrxoBloxPrereqs.h"
5
6#include "tools/Timer.h"
7
8#include "gametypes/Deathmatch.h"
[12212]9#include "OrxoBloxCenterpoint.h"
[12288]10#include "OrxoBloxWall.h"
[12337]11#include "OrxoBloxShip.h"
[12210]12
13namespace orxonox
14{
15
16    /**
17    @brief
[12212]18        Implements a OrxoBlox minigame (<a href="http://en.wikipedia.org/wiki/OrxoBlox">Wikipedia::OrxoBlox</a>).
19        It connects the different entities present in a game of OrxoBlox.
[12210]20
[12212]21        - 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 />
22        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 />
23        The @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>OrxoBlox</em>.
24        - 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).
25        - 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]26
27    @author
28        Fabian 'x3n' Landau
29
[12212]30    @ingroup OrxoBlox
[12210]31    */
[12212]32    class _OrxoBloxExport OrxoBlox : public Deathmatch
[12210]33    {
34        public:
[12212]35            OrxoBlox(Context* context); //!< Constructor. Registers and initializes the object.
36            virtual ~OrxoBlox(); //!< Destructor. Cleans up, if initialized.
[12210]37
[12212]38            virtual void start() override; //!< Starts the OrxoBlox minigame.
39            virtual void end() override; ///!< Ends the OrxoBlox minigame.
[12210]40
[12359]41            PlayerInfo* getPlayer();
[12367]42            virtual void playerPreSpawn(PlayerInfo* player) override;
[12391]43            virtual void tick(float dt) override;
[12210]44
[12331]45            void LevelUp();
46
[12210]47            /**
[12212]48            @brief Set the OrxoBloxCenterpoint (the playing field).
49            @param center A pointer to the OrxoBloxCenterpoint to be set.
[12210]50            */
[12212]51            void setCenterpoint(OrxoBloxCenterpoint* center)
[12210]52                { this->center_ = center; }
53
[12307]54            OrxoBloxCenterpoint* getCenterpoint(void)
55                { return this->center_; }
[12370]56            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
[12394]57            void count();
[12210]58        protected:
[12307]59        private:
60            void startWall(void);
61            void createWall(void);
[12210]62            void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats.
63
[12212]64            WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
[12337]65            unsigned int level_;
[12343]66
[12337]67            WeakPtr<OrxoBloxShip> playership;
[12307]68            PlayerInfo* player_;
[12210]69            Timer starttimer_; //!< A timer to delay the start of the game.
[12307]70           
[12280]71            WeakPtr<OrxoBloxWall> futureWall_;
[12394]72            int counter;
[12400]73            const int max_counter = 5;
[12343]74
[12210]75    };
76}
77
[12212]78#endif /* _OrxoBlox_H__ */
Note: See TracBrowser for help on using the repository browser.