[11593] | 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 | * Florian Zinggeler |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
[11617] | 29 | |
---|
| 30 | |
---|
[11593] | 31 | /** |
---|
| 32 | @file Asteroids2D.h |
---|
| 33 | @brief Gametype. |
---|
| 34 | @ingroup Asteroids2D |
---|
| 35 | */ |
---|
| 36 | |
---|
| 37 | #ifndef _Asteroids2D_H__ |
---|
| 38 | #define _Asteroids2D_H__ |
---|
| 39 | |
---|
| 40 | #include "asteroids2D/Asteroids2DPrereqs.h" |
---|
| 41 | |
---|
| 42 | #include "Asteroids2DCenterPoint.h" // Necessary for WeakPointer?? |
---|
| 43 | //#include "Asteroids2DShip.h" DO NOT include in Header. Will cause forward declaration issues |
---|
| 44 | |
---|
| 45 | //#include "Asteroids2DHUDinfo.h" |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | #include "core/EventIncludes.h" |
---|
| 49 | #include "core/command/Executor.h" |
---|
| 50 | #include "core/config/ConfigValueIncludes.h" |
---|
| 51 | |
---|
| 52 | #include "gamestates/GSLevel.h" |
---|
| 53 | #include "chat/ChatManager.h" |
---|
[11608] | 54 | #include <vector> |
---|
[11593] | 55 | |
---|
| 56 | // ! HACK |
---|
| 57 | #include "infos/PlayerInfo.h" |
---|
| 58 | |
---|
| 59 | #include "core/command/ConsoleCommand.h" |
---|
| 60 | |
---|
| 61 | #include "gametypes/Deathmatch.h" |
---|
[11608] | 62 | #include "tools/Timer.h" |
---|
[11593] | 63 | |
---|
| 64 | namespace orxonox |
---|
| 65 | { |
---|
| 66 | |
---|
| 67 | class _Asteroids2DExport Asteroids2D : public Deathmatch |
---|
| 68 | { |
---|
| 69 | public: |
---|
| 70 | Asteroids2D(Context* context); |
---|
| 71 | |
---|
| 72 | virtual void start() override; |
---|
| 73 | virtual void end() override; |
---|
[11608] | 74 | |
---|
[11593] | 75 | virtual void tick(float dt) override; |
---|
| 76 | |
---|
[11608] | 77 | virtual void playerPreSpawn(PlayerInfo* player) override; |
---|
| 78 | |
---|
| 79 | void levelUp(); |
---|
| 80 | |
---|
[11637] | 81 | |
---|
| 82 | //For HUD |
---|
[11608] | 83 | int getLives(){return this->lives;} |
---|
| 84 | int getLevel(){return this->level;} |
---|
| 85 | int getPoints(){return this->point;} |
---|
| 86 | int getMultiplier(){return this->multiplier;} |
---|
| 87 | |
---|
[11637] | 88 | //Generate Stones |
---|
[11616] | 89 | void spawnStone(); |
---|
[11593] | 90 | void setCenterpoint(Asteroids2DCenterPoint* center) |
---|
[11637] | 91 | { this->center_ = center; } |
---|
| 92 | void addPoints(int numPoints); |
---|
[11608] | 93 | virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command |
---|
[11593] | 94 | |
---|
[11608] | 95 | // checks if multiplier should be reset. |
---|
| 96 | void costLife(); |
---|
[11637] | 97 | Asteroids2DShip* getPlayer(); |
---|
[11608] | 98 | |
---|
[11593] | 99 | bool bEndGame; |
---|
[11608] | 100 | bool bShowLevel; |
---|
| 101 | int lives; |
---|
| 102 | int multiplier; |
---|
[11593] | 103 | |
---|
| 104 | private: |
---|
| 105 | |
---|
[11619] | 106 | |
---|
[11637] | 107 | |
---|
[11593] | 108 | WeakPtr<Asteroids2DShip> player; |
---|
[11608] | 109 | void toggleShowLevel(){bShowLevel = !bShowLevel;} |
---|
| 110 | |
---|
[11593] | 111 | WeakPtr<Asteroids2DCenterPoint> center_; |
---|
[11608] | 112 | int level; |
---|
| 113 | int point; |
---|
[11616] | 114 | bool b_combo, firstTick_; |
---|
[11593] | 115 | |
---|
[11608] | 116 | Timer comboTimer; |
---|
| 117 | Timer showLevelTimer; |
---|
[11617] | 118 | Timer levelupTimer; |
---|
| 119 | Timer endGameTimer; |
---|
[11593] | 120 | |
---|
[11619] | 121 | |
---|
[11593] | 122 | }; |
---|
| 123 | } |
---|
| 124 | |
---|
| 125 | #endif /* _Asteroids2D_H__ */ |
---|