Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 15, 2012, 11:51:58 PM (12 years ago)
Author:
jo
Message:

Merging presentation2011 branch to trunk. Please check for possible bugs.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/gametypes/RaceCheckPoint.h

    r8767 r9016  
    3232#include "gametypes/GametypesPrereqs.h"
    3333
    34 #include "objects/triggers/DistanceTrigger.h"
     34
     35
     36#include "objects/triggers/DistanceMultiTrigger.h"
    3537#include "interfaces/RadarViewable.h"
    3638
     
    4042    @brief
    4143        The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
    42         !!! Don't forget to control the indexes of your check points and to set one last check point!!!
     44         Don't forget to control the indexes of your check points and to set one last check point
    4345    */
    44     class _GametypesExport RaceCheckPoint : public DistanceTrigger, public RadarViewable
     46    class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
    4547    {
    4648        public:
     
    5052            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5153            virtual void tick(float dt);
     54            inline void setCheckpointIndex(int checkpointIndex)
     55                { this->bCheckpointIndex_ = checkpointIndex; }
     56            inline int getCheckpointIndex()
     57                { return this->bCheckpointIndex_; }
    5258
    53             protected:
    54             virtual void triggered(bool bIsTriggered);
     59            inline void setNextcheckpoint(const Vector3& checkpoints)
     60                { this->nextcheckpoints_=checkpoints; }
     61            inline void setNextcheckpoint(float x, float y, float z)
     62                { this->setNextcheckpoint(Vector3(x, y, z)); }
     63            inline const Vector3& getNextcheckpoint() const
     64                { return this->nextcheckpoints_; }
    5565            inline void setLast(bool isLast)
    5666                { this->bIsLast_ = isLast; }
    5767            inline bool getLast()
    5868                { return this->bIsLast_; }
    59             inline void setCheckpointIndex(int checkpointIndex)
    60                 { this->bCheckpointIndex_ = checkpointIndex; }
    61             inline int getCheckpointIndex()
    62                 { return this->bCheckpointIndex_; }
     69
     70            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
     71            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
     72            PlayerInfo* reached_;
     73               
     74            inline float getTimeLimit()
     75                { return this->bTimeLimit_; }
     76   
     77        protected:
     78            virtual void fire(bool bIsTriggered,BaseObject* player);
    6379            virtual void setTimelimit(float timeLimit);
    64             inline float getTimeLimit()
    65                 { return this->bTimeLimit_;}
     80           
    6681            inline const WorldEntity* getWorldEntity() const
    6782                { return this; }
    6883
    6984        private:
    70             int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
    71             bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
    72             float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
    73      
     85            int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0
     86            Vector3 nextcheckpoints_; //the indexes of the next check points
     87           
    7488    };
    7589}
Note: See TracChangeset for help on using the changeset viewer.