Changeset 2935
- Timestamp:
- Apr 27, 2009, 5:12:59 PM (16 years ago)
- Location:
- code/branches/gametypes/src/orxonox/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/objects/gametypes/UnderAttack.cc
r2933 r2935 121 121 void UnderAttack::tick(float dt) 122 122 { 123 gameTime_ = gameTime_ - dt; 124 if (gameTime_<= 0) 123 SUPER(UnderAttack, tick, dt); 124 125 if (this->hasStarted()) 125 126 { 126 gameEnded_ = true; 127 COUT(0) << "Time is up! Team 1 has won!" << std::endl; 127 gameTime_ = gameTime_ - dt; 128 if (gameTime_<= 0 && !gameEnded_) 129 { 130 gameEnded_ = true; 131 COUT(0) << "Time is up! Team 1 has won!" << std::endl; 132 } 128 133 } 129 134 } -
code/branches/gametypes/src/orxonox/objects/worldentities/pawns/Destroyer.cc
r2933 r2935 39 39 #include "core/XMLPort.h" 40 40 #include "objects/items/Engine.h" 41 #include "objects/gametypes/UnderAttack.h" 41 42 42 43 namespace orxonox … … 48 49 RegisterObject(Destroyer); 49 50 51 UnderAttack* gametype = dynamic_cast<UnderAttack*>(this->getGametype()); 52 if (gametype) 53 { 54 gametype->addDestroyer(this); 55 } 50 56 } 51 57
Note: See TracChangeset
for help on using the changeset viewer.