Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h @ 11617

Last change on this file since 11617 was 11617, checked in by vyang, 6 years ago

spawnEnemy und Templates für die 3 Grössen der Asteroiden geschrieben.

File size: 3.2 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 *      Florian Zinggeler
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29
30
31/**
32    @file Asteroids2D.h
33    @brief Gametype.
34    @ingroup Asteroids2D
35*/
36
37#ifndef _Asteroids2D_H__
38#define _Asteroids2D_H__
39
40#include "asteroids2D/Asteroids2DPrereqs.h"
41
42#include "Asteroids2DCenterPoint.h" // Necessary for WeakPointer??
43//#include "Asteroids2DShip.h"        DO NOT include in Header. Will cause forward declaration issues
44
45//#include "Asteroids2DHUDinfo.h"
46
47
48#include "core/EventIncludes.h"
49#include "core/command/Executor.h"
50#include "core/config/ConfigValueIncludes.h"
51
52#include "gamestates/GSLevel.h"
53#include "chat/ChatManager.h"
54#include <vector>
55
56// ! HACK
57#include "infos/PlayerInfo.h"
58
59#include "core/command/ConsoleCommand.h"
60
61#include "gametypes/Deathmatch.h"
62#include "tools/Timer.h"
63
64namespace orxonox
65{
66
67    class _Asteroids2DExport Asteroids2D : public Deathmatch
68    {
69       public:
70            Asteroids2D(Context* context);
71
72            virtual void start() override;
73            virtual void end() override;
74
75            virtual void tick(float dt) override;
76
77            virtual void playerPreSpawn(PlayerInfo* player) override;
78
79            void levelUp();
80
81            int getLives(){return this->lives;}
82            int getLevel(){return this->level;}
83            int getPoints(){return this->point;}
84            int getMultiplier(){return this->multiplier;}
85
86            void spawnStone();
87            void setCenterpoint(Asteroids2DCenterPoint* center)
88                       { this->center_ = center; }
89            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
90
91            // checks if multiplier should be reset.
92            void costLife();
93
94
95            bool bEndGame;
96            bool bShowLevel;
97            int lives;
98            int multiplier;
99
100       private:
101            Timer endGameTimer;
102
103            Asteroids2DShip* getPlayer();
104            WeakPtr<Asteroids2DShip> player;
105            void toggleShowLevel(){bShowLevel = !bShowLevel;}
106            void addPoints(int numPoints);
107
108            WeakPtr<Asteroids2DCenterPoint> center_;
109            int level;
110            int point;
111            bool b_combo, firstTick_;
112
113            Timer comboTimer;
114            Timer showLevelTimer;
115            Timer levelupTimer;
116            Timer endGameTimer;
117
118    };
119}
120
121#endif /* _Asteroids2D_H__ */
Note: See TracBrowser for help on using the repository browser.