Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 11725 was 11669, checked in by vyang, 7 years ago

Kommentare

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