/* * 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{ float r; float x; float y; Circle(float new_r, float new_x, float 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(float x); void createAsteroid(Circle &c); void asteroidField(float x, float y, float slope); void spawnTube(); int getPoints(){return this->point;} void levelUp(); bool isDead(); void setDead(bool value); FlappyOrxShip* getPlayer(); inline void setSpeedBase(float speedBase){ this-> speedBase = speedBase;} inline float getSpeedBase(){ return speedBase;} inline void setSpeedIncrease(float speedIncrease){ this-> speedIncrease = speedIncrease;} inline float getSpeedIncrease(){ return speedIncrease;} inline void setTubeDistanceBase(float tubeDistanceBase){ this-> tubeDistanceBase = tubeDistanceBase;} inline float getTubeDistanceBase(){ return tubeDistanceBase;} inline void setTubeDistanceIncrease(float tubeDistanceIncrease){ this-> tubeDistanceIncrease = tubeDistanceIncrease;} inline float getTubeDistanceIncrease(){ return tubeDistanceIncrease;} bool bIsDead; bool firstGame; std::string sDeathMessage; private: void clearCircles(); bool circleCollision(Circle &c1, Circle &c2); int addIfPossible(Circle c); int point; float speedBase; float speedIncrease; float tubeDistanceBase; float tubeDistanceIncrease; float tubeDistance; float tubeOffsetX; WeakPtr player; std::queue tubes; //Saves Position of Tubes std::queue asteroids; //Stores Asteroids which build up the tubes const static int NUM_CIRCLES = 6; int circlesUsed; Circle circles[NUM_CIRCLES]; const static 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"}; const 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."}; const 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."}; const 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"}; const 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__ */