Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/spacerace/src/modules/gametypes/SpaceRace.h @ 8616

Last change on this file since 8616 was 8616, checked in by msalomon, 13 years ago

RaceCheckPoints with a time limit and the version of the level for the presentation.

File size: 2.3 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 *      Mauro Salomon
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _SpaceRace_H__
30#define _SpaceRace_H__
31
32#include "gametypes/Gametype.h"
33#include "gametypes/GametypesPrereqs.h"
34#include "RaceCheckPoint.h"
35#include <boost/concept_check.hpp>
36#include <util/Clock.h>
37#include <string.h>
38#include <set>
39
40namespace orxonox
41{
42  /**
43  @brief
44  The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
45  */
46    class _OrxonoxExport SpaceRace : public Gametype
47    {
48        public:
49            SpaceRace(BaseObject* creator);
50            virtual ~SpaceRace() {}
51           
52            virtual void tick(float dt);
53           
54            virtual void start();
55            virtual void end();
56           
57            virtual void newCheckpointReached();
58           
59            inline void setCheckpointsReached(int n)
60                { this->bCheckpointsReached_ = n;}
61            inline int getCheckpointsReached()
62                { return this->bCheckpointsReached_; }
63            inline void timeIsUp()
64                { this->bTimeIsUp_ = true;}
65            Clock *clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
66        protected:
67           
68        private:
69            int bCheckpointsReached_; //The current number of check points reached by the player.
70            std::set<float> scores_; //The times of the players are saved in a set.
71            bool bTimeIsUp_; //True if one of the check points is reached too late.
72    };
73}
74
75#endif
Note: See TracBrowser for help on using the repository browser.