Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

faster asteroid spawning

File size: 4.9 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#include "gametypes/Deathmatch.h"
40#include <vector>
41
42namespace orxonox
43{
44    struct Circle{
45        int r;
46        int x;
47        int y;
48        Circle(int new_r, int new_x, int new_y){
49            r=new_r;
50            x=new_x;
51            y=new_y;
52        }
53        Circle(){
54            r=0;
55            x=0;
56            y=0;
57        }
58    };
59
60    class _FlappyOrxExport FlappyOrx : public Deathmatch
61    {
62        public:
63            FlappyOrx(Context* context);
64
65            virtual void start() override;
66            virtual void end() override;
67            virtual void death();
68            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
69
70            void updatePlayerPos(int x);
71            void createAsteroid(Circle &c);
72            void asteroidField(int x, int y, float slope);
73            void spawnTube();
74           
75            void setCenterpoint(FlappyOrxCenterPoint* center);
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            bool bEndGame;
87            bool bIsDead;
88            bool firstGame;
89            std::string sDeathMessage;
90            std::queue<int> tubes;
91            std::queue<MovableEntity*> asteroids;
92            int spawnDistance;
93            int tubeOffsetX;
94           
95        private:
96             
97            const static int nCircles = 6;
98            int circlesUsed;
99            Circle circles[nCircles];
100
101            void clearCircles();
102            bool circleCollision(Circle &c1, Circle &c2);
103            int addIfPossible(Circle c);
104
105            WeakPtr<FlappyOrxCenterPoint> center_;
106            WeakPtr<FlappyOrxShip> player;
107
108            int level;
109            int point;
110            bool b_combo;
111
112            const int NUM_ASTEROIDS = 5;
113
114
115           const std::string Asteroid5[5] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5"};
116           const std::string Asteroid10[5] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5"};
117           const std::string Asteroid15[5] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5"};
118           const std::string Asteroid20[5] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5"};
119           
120            std::vector<std::string> DeathMessage10 = {
121                "You should really try that again",
122                "You can do better, can you?",
123                "Hey, maybe you get a participation award, that's good isn't it?",
124                "Congratulations, you get a medal, a wooden one",
125                "That was flappin bad!",
126                "Well, that was a waste of time"};
127            std::vector<std::string> DeathMessage30 = {
128                "Getting better!",
129                "Training has paid off, huh?",
130                "Good average!",
131                "That was somehow enjoyable to watch",
132                "Flappin average",
133                "Getting closer to something",
134                "That wasn't crap, not bad"};
135            std::vector<std::string> DeathMessage50 = {
136                "Flappin great",
137                "Good job!",
138                "Okay, we give you a shiny medal, not a golden one, tough",
139                "Maybe you should do that professionally",
140                "That was really good,!",
141                "We are proud of you"};
142            std::vector<std::string> DeathMessageover50 = {
143                "You're flappin amazing",
144                "Fucking great job",
145                "Wow, we're really impressed",
146                "We will honor you!",
147                "Please do that again!",
148                "Take that golden medal! You've earned it"};
149           
150
151
152
153    };
154}
155
156#endif /* _FlappyOrx_H__ */
Note: See TracBrowser for help on using the repository browser.