Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Presentation_HS17_merge/src/modules/flappyorx/FlappyOrx.h @ 11757

Last change on this file since 11757 was 11757, checked in by landauf, 6 years ago

[FlappyOrx_HS17] removed FlappyOrxCenterPoint, it doesn't seem to be neede

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