Changeset 2978
- Timestamp:
- May 17, 2009, 9:23:41 PM (16 years ago)
- Location:
- code/branches/gametypes/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/objects/gametypes/Asteroids.cc
r2970 r2978 44 44 RegisterObject(Asteroids); 45 45 this->firstCheckpointReached_ = false; 46 this->timeLimit_ = 30;47 46 } 48 47 … … 51 50 SUPER(Asteroids, tick, dt); 52 51 53 if (firstCheckpointReached_ )52 if (firstCheckpointReached_ && !this->timerIsActive_) 54 53 { 55 this->timeLimit_ = this->time_;56 54 this->startTimer(); 57 55 } 58 56 59 if (this->time_ < 0 && !this->hasEnded() )57 if (this->time_ < 0 && !this->hasEnded() && this->timerIsActive_) 60 58 { 61 59 this->end(); -
code/branches/gametypes/src/orxonox/objects/gametypes/Gametype.h
r2970 r2978 130 130 131 131 inline void startTimer() 132 { this->timerIsActive_ = true; } 132 { 133 this->time_ = this->timeLimit_; 134 this->timerIsActive_ = true; 135 } 133 136 134 137 inline void stopTimer() … … 140 143 inline bool getTimerIsActive() 141 144 { return timerIsActive_; } 145 146 inline void setTimeLimit(float t) 147 { this->timeLimit_ = t; } 142 148 143 149 virtual void resetTimer(); -
code/branches/gametypes/src/orxonox/objects/worldentities/triggers/CheckPoint.cc
r2970 r2978 50 50 this->bIsFirst_ = false; 51 51 this->bIsDestination_ = false; 52 this->setVisible(true);52 //this->setVisible(true); 53 53 } 54 54 … … 77 77 if (bIsTriggered && bIsFirst_) 78 78 { 79 gametype->setTimeLimit(addTime_); 79 80 gametype->firstCheckpointReached(true); 80 81 } -
code/branches/gametypes/src/orxonox/overlays/hud/HUDTimer.cc
r2970 r2978 63 63 if (gametype->getTimerIsActive()) 64 64 { 65 this->setCaption(convertToString((int)gametype->getTime() ));65 this->setCaption(convertToString((int)gametype->getTime() + 1)); 66 66 } 67 67 }
Note: See TracChangeset
for help on using the changeset viewer.