Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Presentation_HS17_merge/src/modules/flappyorx/FlappyOrxShip.h @ 11775

Last change on this file since 11775 was 11761, checked in by landauf, 7 years ago

[FlappyOrx_HS17] bugfix: velocity was never initialized (expecially x, which wasn't necessary anyway)

File size: 3.4 KB
Line 
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 *      Leo Merholz
24 *      Pascal Schärli
25 *   Co-authors:
26 *      ...
27 *
28 */
29
30/**
31    @file FlappyOrxShip.h
32    @brief Declaration of the FlappyOrxShip class.
33*/
34
35#ifndef _FlappyOrxShip_H__
36#define _FlappyOrxShip_H__
37
38#include "flappyorx/FlappyOrxPrereqs.h"
39
40#include "weapons/WeaponsPrereqs.h"
41#include "worldentities/pawns/SpaceShip.h"
42#include "graphics/ParticleSpawner.h"
43#include "FlappyOrx.h"
44
45
46namespace orxonox
47{
48    class _FlappyOrxExport FlappyOrxShip : public SpaceShip
49    {
50        public:
51            FlappyOrxShip(Context* context);
52
53            virtual void tick(float dt) override;
54
55            // Starts or stops fireing
56            virtual void boost(bool bBoost) override;
57           
58            inline void  setSpeedBase(float speedBase){ getGame()->setSpeedBase(speedBase);}
59            inline float getSpeedBase(){ return getGame()->getSpeedBase();}
60            inline void  setSpeedIncrease(float speedIncrease){ getGame()->setSpeedIncrease(speedIncrease);}
61            inline float getSpeedIncrease(){ return getGame()->getSpeedIncrease();}
62
63            inline void setTubeDistanceBase(float tubeDistanceBase){ getGame()->setTubeDistanceBase(tubeDistanceBase);}
64            inline float  getTubeDistanceBase(){ return getGame()->getTubeDistanceBase();}
65            inline void setTubeDistanceIncrease(float tubeDistanceIncrease){ getGame()->setTubeDistanceIncrease(tubeDistanceIncrease);}
66            inline float  getTubeDistanceIncrease(){ return getGame()->getTubeDistanceIncrease();}
67
68            inline void  setUpwardthrust( float upwardThrust ){ this->upwardThrust = upwardThrust; }
69            inline float getUpwardthrust(){ return this->upwardThrust; }
70            inline void  setGravity( float gravity ){ this->gravity = gravity; }
71            inline float getGravity(){ return this->gravity; }
72
73            inline void setSpeed( float speed ){ this->speed = speed; }
74            inline float getSpeed( ){ return this->speed; }
75           
76   
77            virtual time_t timeUntilRespawn();
78           
79            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
80
81
82        protected:
83            virtual void death() override;
84        private:
85            FlappyOrx* getGame();
86            WeakPtr<FlappyOrx> game;
87            ParticleSpawner* particlespawner_;
88            bool isFlapping;
89            bool isDead;
90            float velocity;
91            float speed, upwardThrust, gravity;
92            float particleAge, particleLifespan;
93            time_t deathTime;
94
95    };
96}
97
98#endif /* _FlappyOrxShip_H__ */
Note: See TracBrowser for help on using the repository browser.