Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Projektile fliegen in 2D Ebene, jedoch in eine falsche Richtung. Kommentare hinzugefuegt

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