Orxonox  0.0.5 Codename: Arcturus
FlappyOrx.h
Go to the documentation of this file.
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 
36 #ifndef _FlappyOrx_H__
37 #define _FlappyOrx_H__
38 
40 
41 
42 #include "gametypes/Deathmatch.h"
43 #include <vector>
44 
45 namespace 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 
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  inline void setSpeedBase(float speedBase){ this-> speedBase = speedBase;}
87  inline float getSpeedBase(){ return speedBase;}
88  inline void setSpeedIncrease(float speedIncrease){ this-> speedIncrease = speedIncrease;}
89  inline float getSpeedIncrease(){ return speedIncrease;}
90 
91  inline void setTubeDistanceBase(float tubeDistanceBase){ this-> tubeDistanceBase = tubeDistanceBase;}
92  inline float getTubeDistanceBase(){ return tubeDistanceBase;}
93  inline void setTubeDistanceIncrease(float tubeDistanceIncrease){ this-> tubeDistanceIncrease = tubeDistanceIncrease;}
94  inline float getTubeDistanceIncrease(){ return tubeDistanceIncrease;}
95 
96 
97  bool bIsDead;
98  bool firstGame;
100 
101  private:
102  void clearCircles();
103  bool circleCollision(Circle &c1, Circle &c2);
104  int addIfPossible(Circle c);
105 
106  int point;
107 
108  float speedBase;
110 
114  float tubeOffsetX;
115 
117  std::queue<float> tubes; //Saves Position of Tubes
118  std::queue<MovableEntity*> asteroids; //Stores Asteroids which build up the tubes
119 
120  const static int NUM_CIRCLES = 6;
122  Circle circles[NUM_CIRCLES];
123 
124  const static int NUM_ASTEROIDS = 5;
125 
126  const std::string Asteroid5[5] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5"};
127  const std::string Asteroid10[5] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5"};
128  const std::string Asteroid15[5] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5"};
129  const std::string Asteroid20[5] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5"};
130 
131  const std::vector<std::string> DeathMessage7 = {
132  "You should really try that again",
133  "You can do better, can you?",
134  "Hey, maybe you get a participation award, that's good isn't it?",
135  "Congratulations, you get a medal, a wooden one",
136  "That was flappin bad!",
137  "Well, that was a waste of time",
138  "You suck!",
139  "Maybe try SuperOrxoBros. That game is not as hard.",
140  "Here's a tip: Try not to fly into these grey thingies.",
141  "We won't comment on that."};
142  const std::vector<std::string> DeathMessage20 = {
143  "Getting better!",
144  "Training has paid off, huh?",
145  "Good average!",
146  "That was somehow enjoyable to watch",
147  "Flappin average",
148  "Getting closer to something",
149  "That wasn't crap, not bad",
150  "Surprisingly not bad."};
151  const std::vector<std::string> DeathMessage30 = {
152  "Flappin great",
153  "Good job!",
154  "Okay, we give you a shiny medal, not a golden one, tough",
155  "Maybe you should do that professionally",
156  "That was really good,!",
157  "We are proud of you"};
158  const std::vector<std::string> DeathMessageover30 = {
159  "You're flappin amazing",
160  "Fucking great job",
161  "Wow, we're really impressed",
162  "We will honor you!",
163  "Please, please do that again!",
164  "Take that golden medal! You've earned it",
165  "We are completely speechless! That was magnificent"};
166 
167 
168 
169 
170  };
171 }
172 
173 #endif /* _FlappyOrx_H__ */
float getSpeedBase()
Definition: FlappyOrx.h:87
std::queue< MovableEntity * > asteroids
Definition: FlappyOrx.h:118
float r
Definition: FlappyOrx.h:48
float tubeOffsetX
Definition: FlappyOrx.h:114
float x
Definition: FlappyOrx.h:49
Definition: FlappyOrx.h:47
WeakPtr< FlappyOrxShip > player
Definition: FlappyOrx.h:116
void setTubeDistanceIncrease(float tubeDistanceIncrease)
Definition: FlappyOrx.h:93
::std::string string
Definition: gtest-port.h:756
void setSpeedIncrease(float speedIncrease)
Definition: FlappyOrx.h:88
#define _FlappyOrxExport
Definition: FlappyOrxPrereqs.h:61
Circle()
Definition: FlappyOrx.h:56
Definition: FlappyOrx.h:63
int point
Definition: FlappyOrx.h:106
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
float getTubeDistanceBase()
Definition: FlappyOrx.h:92
float y
Definition: FlappyOrx.h:50
std::queue< float > tubes
Definition: FlappyOrx.h:117
bool bIsDead
Definition: FlappyOrx.h:97
std::string sDeathMessage
Definition: FlappyOrx.h:99
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
int circlesUsed
Definition: FlappyOrx.h:121
Definition: Context.h:45
Shared library macros, enums, constants and forward declarations for the FlappyOrx module ...
void setTubeDistanceBase(float tubeDistanceBase)
Definition: FlappyOrx.h:91
void setSpeedBase(float speedBase)
Definition: FlappyOrx.h:86
float tubeDistanceIncrease
Definition: FlappyOrx.h:112
float speedBase
Definition: FlappyOrx.h:108
Definition: Deathmatch.h:37
Circle(float new_r, float new_x, float new_y)
Definition: FlappyOrx.h:51
int getPoints()
Definition: FlappyOrx.h:77
float speedIncrease
Definition: FlappyOrx.h:109
Definition: FlappyOrxShip.h:48
float tubeDistance
Definition: FlappyOrx.h:113
float getSpeedIncrease()
Definition: FlappyOrx.h:89
float getTubeDistanceIncrease()
Definition: FlappyOrx.h:94
bool firstGame
Definition: FlappyOrx.h:98
float tubeDistanceBase
Definition: FlappyOrx.h:111