Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

XML Port

File size: 6.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 *      Leo Mehr Holz
24 *      Pascal Schärli
25 *
26 */
27
28/**
29    @file FlappyOrx.h
30    @brief Gametype.
31    @ingroup FlappyOrx
32*/
33
34#ifndef _FlappyOrx_H__
35#define _FlappyOrx_H__
36
37#include "flappyorx/FlappyOrxPrereqs.h"
38   
39
40#include "gametypes/Deathmatch.h"
41#include <vector>
42
43namespace orxonox
44{
45    struct Circle{
46        int r;
47        int x;
48        int y;
49        Circle(int new_r, int new_x, int new_y){
50            r=new_r;
51            x=new_x;
52            y=new_y;
53        }
54        Circle(){
55            r=0;
56            x=0;
57            y=0;
58        }
59    };
60
61    class _FlappyOrxExport FlappyOrx : public Deathmatch
62    {
63        public:
64            FlappyOrx(Context* context);
65
66            virtual void start() override;
67            virtual void end() override;
68            virtual void death();
69            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
70            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
71           
72            void setspawnDistance( int spawnDistance)
73                {this->spawnDistance = spawnDistance; }
74            int getspawnDistance()
75                { return this->spawnDistance; } 
76            inline void setSpeed( float speed ){   
77                orxout()<< speed<< endl;
78                this->speed = speed; }
79            inline float getSpeed( )
80                { return this->speed; }
81
82            void updatePlayerPos(int x);
83            void createAsteroid(Circle &c);
84            void asteroidField(int x, int y, float slope);
85            void spawnTube();
86           
87            void setCenterpoint(FlappyOrxCenterPoint* center);
88           
89            int getPoints(){return this->point;}
90           
91            void levelUp();
92           
93            bool isDead();
94            void setDead(bool value);
95
96            FlappyOrxShip* getPlayer();
97           
98            float speedBase;
99            float speedIncrease;
100
101            int tubeDistanceBase;
102            int tubeDistanceIncrease;
103            int tubeDistance;
104            int tubeOffsetX;
105
106            int upwardThrust;
107            int gravity;
108
109            inline void setSpeedBase(int speedBase){ this-> speedBase =  speedBase;}
110            inline float  getSpeedBase(){ return speedBase;}
111            inline void setSpeedIncrease(int speedIncrease){ this-> speedIncrease =  speedIncrease;}
112            inline float  getSpeedIncrease(){ return speedIncrease;}
113
114            inline void setTubeDistanceBase(int tubeDistanceBase){ this-> tubeDistanceBase =  tubeDistanceBase;}
115            inline int  getTubeDistanceBase(){ return tubeDistanceBase;}
116            inline void setTubeDistanceIncrease(int tubeDistanceIncrease){ this-> tubeDistanceIncrease =  tubeDistanceIncrease;}
117            inline int  getTubeDistanceIncrease(){ return tubeDistanceIncrease;}
118
119           
120            bool bEndGame;
121            bool bIsDead;
122            bool firstGame;
123            std::string sDeathMessage;
124            std::queue<int> tubes;                  //Saves Position of Tubes
125            std::queue<MovableEntity*> asteroids;   //Stores Asteroids which build up the tubes
126            float speed = 100;
127           
128        private:
129             
130            const static int nCircles = 6;
131            int circlesUsed;
132            Circle circles[nCircles];
133
134            void clearCircles();
135            bool circleCollision(Circle &c1, Circle &c2);
136            int addIfPossible(Circle c);
137
138            WeakPtr<FlappyOrxCenterPoint> center_;
139            WeakPtr<FlappyOrxShip> player;
140
141            int level;
142            int point;
143            bool b_combo;
144
145            const int NUM_ASTEROIDS = 5;
146
147
148           const std::string Asteroid5[5] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5"};
149           const std::string Asteroid10[5] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5"};
150           const std::string Asteroid15[5] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5"};
151           const std::string Asteroid20[5] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5"};
152           
153            std::vector<std::string> DeathMessage10 = {
154                "You should really try that again",
155                "You can do better, can you?",
156                "Hey, maybe you get a participation award, that's good isn't it?",
157                "Congratulations, you get a medal, a wooden one",
158                "That was flappin bad!",
159                "Well, that was a waste of time",
160                "You suck!",
161                "Maybe try SuperOrxoBros? That game is not as hard.",
162                "Here's a tip: Try not to fly into these grey thingies."};
163            std::vector<std::string> DeathMessage30 = {
164                "Getting better!",
165                "Training has paid off, huh?",
166                "Good average!",
167                "That was somehow enjoyable to watch",
168                "Flappin average",
169                "Getting closer to something",
170                "That wasn't crap, not bad",
171                "Surprisingly not bad."};
172            std::vector<std::string> DeathMessage50 = {
173                "Flappin great",
174                "Good job!",
175                "Okay, we give you a shiny medal, not a golden one, tough",
176                "Maybe you should do that professionally",
177                "That was really good,!",
178                "We are proud of you"};
179            std::vector<std::string> DeathMessageover50 = {
180                "You're flappin amazing",
181                "Fucking great job",
182                "Wow, we're really impressed",
183                "We will honor you!",
184                "Please do that again!",
185                "Take that golden medal! You've earned it"};
186           
187
188
189
190    };
191}
192
193#endif /* _FlappyOrx_H__ */
Note: See TracBrowser for help on using the repository browser.