- Timestamp:
- Dec 5, 2014, 4:27:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
r10158 r10159 29 29 30 30 this->setCollisionType(WorldEntity::Dynamic); 31 this->td = orxonox_cast<TowerDefense*>(this->getGametype().get()); 32 once_ = false; 31 33 32 34 } 35 36 TowerDefenseEnemy::~TowerDefenseEnemy(){this->td->addCredit(20);} 33 37 34 38 void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord) … … 49 53 50 54 //orxout() << "distance" << distance << endl; 51 if(distance <50){ 55 if(distance < 50 && once_ == false){ 56 this->td->reduceLifes(1); 57 once_=true; 52 58 orxout() << "ENEMY KILLED!!!!" << endl; 53 this->destroy(); } 59 this->td->buyTower(20); 60 if (this->td->getLifes()==0) 61 { 62 this->td->end(); 63 } 64 65 } 54 66 } 55 67
Note: See TracChangeset
for help on using the changeset viewer.