Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Asteroiden werden generiert und bewegen sich, HUD muss noch angepasst werden, Punkte und Health und Leben anzeigen. Raumschiff kann noch nicht schiessen, evtl auch Schutzfunktion → nachdem ein Leben verloren wurde 2s Immunitaet?

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
82            //For HUD
83            int getLives(){return this->lives;}
84            int getLevel(){return this->level;}
85            int getPoints(){return this->point;}
86            int getMultiplier(){return this->multiplier;}
87
88            //Generate Stones
89            void spawnStone();
90            void setCenterpoint(Asteroids2DCenterPoint* center)
91                { this->center_ = center; }
92            void addPoints(int numPoints);
93            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
94
95            // checks if multiplier should be reset.
96            void costLife();
97            Asteroids2DShip* getPlayer();
98
99            bool bEndGame;
100            bool bShowLevel;
101            int lives;
102            int multiplier;
103
104       private:
105
106
107
108            WeakPtr<Asteroids2DShip> player;
109            void toggleShowLevel(){bShowLevel = !bShowLevel;}
110
111            WeakPtr<Asteroids2DCenterPoint> center_;
112            int level;
113            int point;
114            bool b_combo, firstTick_;
115
116            Timer comboTimer;
117            Timer showLevelTimer;
118            Timer levelupTimer;
119            Timer endGameTimer;
120
121
122    };
123}
124
125#endif /* _Asteroids2D_H__ */
Note: See TracBrowser for help on using the repository browser.