Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.h @ 11620

Last change on this file since 11620 was 11620, checked in by pascscha, 6 years ago

XML Port

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