Changeset 10134 for code/branches/towerdefenseHS14/src
- Timestamp:
- Nov 26, 2014, 3:58:47 PM (10 years ago)
- Location:
- code/branches/towerdefenseHS14/src/modules/towerdefense
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
r10132 r10134 158 158 // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path. 159 159 160 void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path ){160 void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr){ 161 161 162 162 TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext()); 163 en1->addTemplate("enemytowerdefense"); 164 en1->setScale(3); 163 164 switch(templatenr) 165 { 166 case 1 : 167 en1->addTemplate("enemytowerdefense1"); 168 en1->setScale(3); 169 break; 170 case 2 : 171 en1->addTemplate("enemytowerdefense2"); 172 en1->setScale(2); 173 break; 174 case 3 : 175 en1->addTemplate("enemytowerdefense3"); 176 en1->setScale(1); 177 break; 178 } 179 165 180 en1->getController(); 166 181 … … 283 298 if(time>1 && TowerDefenseEnemyvector.size() < 30) 284 299 { 285 addTowerDefenseEnemy(path); 300 301 addTowerDefenseEnemy(path, rand() %3 +1 ); 286 302 time = time-1; 287 303 } -
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
r10132 r10134 56 56 std::vector<TowerDefenseEnemy*> TowerDefenseEnemyvector; 57 57 58 void addTowerDefenseEnemy(std::vector<TDCoordinate*> path );58 void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr); 59 59 virtual void start(); //<! The function is called when the gametype starts 60 60 virtual void end(); -
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
r10132 r10134 48 48 float distance = ship.distance(*endpoint); 49 49 50 orxout() << "distance" << distance << endl;51 50 if(distance <50){ 52 orxout() << "ENEMY KILLED!!!!" << endl;53 51 this->destroy(); } 54 52 }
Note: See TracChangeset
for help on using the changeset viewer.