Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2978


Ignore:
Timestamp:
May 17, 2009, 9:23:41 PM (16 years ago)
Author:
Aurelian
Message:

some fixes on the timer, visibility of checkpoint removed (done in the xml-file)

Location:
code/branches/gametypes/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gametypes/src/orxonox/objects/gametypes/Asteroids.cc

    r2970 r2978  
    4444        RegisterObject(Asteroids);
    4545        this->firstCheckpointReached_ = false;
    46         this->timeLimit_ = 30;
    4746    }
    4847
     
    5150        SUPER(Asteroids, tick, dt);
    5251 
    53         if (firstCheckpointReached_)
     52        if (firstCheckpointReached_ && !this->timerIsActive_)
    5453        {
    55             this->timeLimit_ = this->time_;
    5654            this->startTimer();
    5755        }
    5856
    59         if (this->time_ < 0 && !this->hasEnded())
     57        if (this->time_ < 0 && !this->hasEnded() && this->timerIsActive_)
    6058        {
    6159            this->end();
  • code/branches/gametypes/src/orxonox/objects/gametypes/Gametype.h

    r2970 r2978  
    130130
    131131            inline  void startTimer()
    132               { this->timerIsActive_ = true; }
     132            {
     133                this->time_ = this->timeLimit_;
     134                this->timerIsActive_ = true;
     135            }
    133136
    134137            inline void stopTimer()
     
    140143            inline bool getTimerIsActive()
    141144              { return timerIsActive_; }
     145
     146            inline void setTimeLimit(float t)
     147              { this->timeLimit_ = t; }
    142148
    143149            virtual void resetTimer();
  • code/branches/gametypes/src/orxonox/objects/worldentities/triggers/CheckPoint.cc

    r2970 r2978  
    5050    this->bIsFirst_ = false;
    5151    this->bIsDestination_ = false;
    52     this->setVisible(true);
     52    //this->setVisible(true);
    5353  }
    5454
     
    7777        if (bIsTriggered && bIsFirst_)
    7878        {
     79            gametype->setTimeLimit(addTime_);
    7980            gametype->firstCheckpointReached(true);
    8081        }
  • code/branches/gametypes/src/orxonox/overlays/hud/HUDTimer.cc

    r2970 r2978  
    6363    if (gametype->getTimerIsActive())
    6464    {
    65       this->setCaption(convertToString((int)gametype->getTime()));
     65      this->setCaption(convertToString((int)gametype->getTime() + 1));
    6666    }
    6767  }
Note: See TracChangeset for help on using the changeset viewer.