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 | |
---|
35 | #ifndef _Asteroids_H__ |
---|
36 | #define _Asteroids_H__ |
---|
37 | |
---|
38 | |
---|
39 | #include "asteroids/AsteroidsPrereqs.h" |
---|
40 | #include "gametypes/Deathmatch.h" |
---|
41 | #include "worldentities/pawns/SpaceShip.h" |
---|
42 | #include "weapons/projectiles/Projectile.h" |
---|
43 | #include <math.h> |
---|
44 | |
---|
45 | namespace orxonox |
---|
46 | { |
---|
47 | |
---|
48 | class _AsteroidsExport Asteroids : public SpaceShip |
---|
49 | { |
---|
50 | public: |
---|
51 | Asteroids(Context* context); |
---|
52 | |
---|
53 | virtual void tick(float dt) override; |
---|
54 | |
---|
55 | // overwrite for 2d movement |
---|
56 | virtual void moveFrontBack(const Vector2& value) override; |
---|
57 | virtual void moveRightLeft(const Vector2& value) override; |
---|
58 | virtual void moveUpDown(const Vector2& value) override; |
---|
59 | |
---|
60 | // Starts or stops fireing |
---|
61 | virtual void boost(bool bBoost) override; |
---|
62 | |
---|
63 | |
---|
64 | void setCenterpoint(AsteroidsCenterPoint* center) |
---|
65 | { this->center_ = center; } |
---|
66 | |
---|
67 | |
---|
68 | virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command |
---|
69 | |
---|
70 | bool bEndGame; |
---|
71 | bool bShowLevel; |
---|
72 | int lives; |
---|
73 | float angle, radius; |
---|
74 | float speed, damping, posforeward; |
---|
75 | bool isFireing; |
---|
76 | |
---|
77 | //Nachschauen wie gross das Spielfeld ist! |
---|
78 | float H = 1000; |
---|
79 | float W = 1000; |
---|
80 | |
---|
81 | protected: |
---|
82 | virtual void death() override; |
---|
83 | |
---|
84 | private: |
---|
85 | Asteroids* getGame(); |
---|
86 | WeakPtr<Asteroids> game; |
---|
87 | WeakPtr<WorldEntity> lastEntity; |
---|
88 | Camera* camera; |
---|
89 | float lastTimeFront, lastTimeLeft, lastTime; |
---|
90 | struct Velocity |
---|
91 | { |
---|
92 | float x; |
---|
93 | float y; |
---|
94 | } velocity, desiredVelocity; |
---|
95 | |
---|
96 | }; |
---|
97 | } |
---|
98 | |
---|
99 | #endif /* _Asteroids_H__ */ |
---|