[11506] | 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 | |
---|
| 29 | /** |
---|
| 30 | @file DodgeRace.h |
---|
| 31 | @brief Gametype. |
---|
| 32 | @ingroup DodgeRace |
---|
| 33 | */ |
---|
| 34 | |
---|
[11516] | 35 | #ifndef _Asteroids_H__ |
---|
| 36 | #define _Asteroids_H__ |
---|
[11506] | 37 | |
---|
| 38 | |
---|
[11516] | 39 | #include "asteroids/AsteroidsPrereqs.h" |
---|
[11506] | 40 | #include "gametypes/Deathmatch.h" |
---|
[11516] | 41 | #include "worldentities/pawns/SpaceShip.h" |
---|
| 42 | #include "weapons/projectiles/Projectile.h" |
---|
| 43 | #include <math.h> |
---|
[11506] | 44 | |
---|
| 45 | namespace orxonox |
---|
| 46 | { |
---|
| 47 | |
---|
[11516] | 48 | class _AsteroidsExport Asteroids : public SpaceShip |
---|
[11506] | 49 | { |
---|
| 50 | public: |
---|
[11516] | 51 | Asteroids(Context* context); |
---|
[11506] | 52 | |
---|
| 53 | virtual void tick(float dt) override; |
---|
| 54 | |
---|
[11555] | 55 | //overwrite for 2d movement |
---|
[11516] | 56 | virtual void moveFrontBack(const Vector2& value) override; |
---|
| 57 | virtual void moveRightLeft(const Vector2& value) override; |
---|
[11506] | 58 | |
---|
[11516] | 59 | // Starts or stops fireing |
---|
[11555] | 60 | //virtual void boost(bool bBoost) override; |
---|
[11506] | 61 | |
---|
| 62 | |
---|
[11528] | 63 | void setCenterpoint(AsteroidsCenterPoint* center) |
---|
[11506] | 64 | { this->center_ = center; } |
---|
[11528] | 65 | |
---|
| 66 | |
---|
[11506] | 67 | virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command |
---|
| 68 | |
---|
| 69 | bool bEndGame; |
---|
| 70 | int lives; |
---|
[11555] | 71 | float direction; |
---|
| 72 | float damping; |
---|
[11516] | 73 | bool isFireing; |
---|
[11541] | 74 | const float maxspeed = 500; |
---|
[11506] | 75 | |
---|
[11555] | 76 | |
---|
[11516] | 77 | //Nachschauen wie gross das Spielfeld ist! |
---|
[11541] | 78 | float height; |
---|
| 79 | float width; |
---|
[11506] | 80 | |
---|
[11541] | 81 | |
---|
| 82 | |
---|
[11516] | 83 | protected: |
---|
| 84 | virtual void death() override; |
---|
[11506] | 85 | |
---|
[11516] | 86 | private: |
---|
| 87 | Asteroids* getGame(); |
---|
| 88 | WeakPtr<Asteroids> game; |
---|
| 89 | WeakPtr<WorldEntity> lastEntity; |
---|
| 90 | float lastTimeFront, lastTimeLeft, lastTime; |
---|
[11555] | 91 | |
---|
| 92 | //Controller |
---|
| 93 | bool moveUpPressed_, moveDownPressed_, moveRightPressed_, moveLeftPressed_; |
---|
[11516] | 94 | |
---|
[11506] | 95 | }; |
---|
| 96 | } |
---|
| 97 | |
---|
[11516] | 98 | #endif /* _Asteroids_H__ */ |
---|