/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Leo Merholz * Pascal Schärli * Co-authors: * ... * */ /** @file FlappyOrx.h @brief Gametype. @ingroup FlappyOrx */ #ifndef _FlappyOrx_H__ #define _FlappyOrx_H__ #include "flappyorx/FlappyOrxPrereqs.h" #include "gametypes/Deathmatch.h" #include namespace orxonox { struct Circle{ int r; int x; int y; Circle(int new_r, int new_x, int new_y){ r=new_r; x=new_x; y=new_y; } Circle(){ r=0; x=0; y=0; } }; class _FlappyOrxExport FlappyOrx : public Deathmatch { public: FlappyOrx(Context* context); virtual void start() override; virtual void end() override; virtual void death(); void updatePlayerPos(int x); void createAsteroid(Circle &c); void asteroidField(int x, int y, float slope); void spawnTube(); void setCenterpoint(FlappyOrxCenterPoint* center); int getPoints(){return this->point;} void levelUp(); bool isDead(); void setDead(bool value); FlappyOrxShip* getPlayer(); float speedBase; float speedIncrease; int tubeDistanceBase; int tubeDistanceIncrease; int tubeDistance; int tubeOffsetX; int upwardThrust; int gravity; inline void setSpeedBase(int speedBase){ this-> speedBase = speedBase;} inline float getSpeedBase(){ return speedBase;} inline void setSpeedIncrease(int speedIncrease){ this-> speedIncrease = speedIncrease;} inline float getSpeedIncrease(){ return speedIncrease;} inline void setTubeDistanceBase(int tubeDistanceBase){ this-> tubeDistanceBase = tubeDistanceBase;} inline int getTubeDistanceBase(){ return tubeDistanceBase;} inline void setTubeDistanceIncrease(int tubeDistanceIncrease){ this-> tubeDistanceIncrease = tubeDistanceIncrease;} inline int getTubeDistanceIncrease(){ return tubeDistanceIncrease;} bool bEndGame; bool bIsDead; bool firstGame; std::string sDeathMessage; std::queue tubes; //Saves Position of Tubes std::queue asteroids; //Stores Asteroids which build up the tubes float speed = 100; private: const static int nCircles = 6; int circlesUsed; Circle circles[nCircles]; void clearCircles(); bool circleCollision(Circle &c1, Circle &c2); int addIfPossible(Circle c); WeakPtr center_; WeakPtr player; int level; int point; bool b_combo; const int NUM_ASTEROIDS = 5; const std::string Asteroid5[5] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5"}; const std::string Asteroid10[5] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5"}; const std::string Asteroid15[5] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5"}; const std::string Asteroid20[5] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5"}; std::vector DeathMessage7 = { "You should really try that again", "You can do better, can you?", "Hey, maybe you get a participation award, that's good isn't it?", "Congratulations, you get a medal, a wooden one", "That was flappin bad!", "Well, that was a waste of time", "You suck!", "Maybe try SuperOrxoBros. That game is not as hard.", "Here's a tip: Try not to fly into these grey thingies.", "We won't comment on that."}; std::vector DeathMessage20 = { "Getting better!", "Training has paid off, huh?", "Good average!", "That was somehow enjoyable to watch", "Flappin average", "Getting closer to something", "That wasn't crap, not bad", "Surprisingly not bad."}; std::vector DeathMessage30 = { "Flappin great", "Good job!", "Okay, we give you a shiny medal, not a golden one, tough", "Maybe you should do that professionally", "That was really good,!", "We are proud of you"}; std::vector DeathMessageover30 = { "You're flappin amazing", "Fucking great job", "Wow, we're really impressed", "We will honor you!", "Please, please do that again!", "Take that golden medal! You've earned it", "We are completely speechless! That was magnificent"}; }; } #endif /* _FlappyOrx_H__ */