Changeset 10141 for code/branches/towerdefenseHS14/src
- Timestamp:
- Nov 26, 2014, 4:41:02 PM (10 years ago)
- Location:
- code/branches/towerdefenseHS14/src/modules/towerdefense
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
r10140 r10141 160 160 // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path. 161 161 162 void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){162 void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr){ 163 163 164 164 TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext()); 165 en1->addTemplate("enemytowerdefense"); 166 en1->setScale(3); 165 166 switch(templatenr) 167 { 168 case 1 : 169 en1->addTemplate("enemytowerdefense1"); 170 en1->setScale(3); 171 break; 172 case 2 : 173 en1->addTemplate("enemytowerdefense2"); 174 en1->setScale(2); 175 break; 176 case 3 : 177 en1->addTemplate("enemytowerdefense3"); 178 en1->setScale(1); 179 break; 180 } 181 167 182 en1->getController(); 168 183 … … 285 300 if(time>1 && TowerDefenseEnemyvector.size() < 30) 286 301 { 287 addTowerDefenseEnemy(path );302 addTowerDefenseEnemy(path, rand() %3 +1 ); 288 303 time = time-1; 289 304 } -
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
r10140 r10141 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();
Note: See TracChangeset
for help on using the changeset viewer.