- Timestamp:
- May 24, 2012, 10:00:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc
r9211 r9236 105 105 /* Temporary hack to allow the player to add towers */ 106 106 this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) ); 107 108 // Quick hack to test waypoints109 createConsoleCommand( "aw", createExecutor( createFunctor(&TowerDefense::addWaypointsAndFirstEnemy, this) ) );110 107 } 111 108 … … 131 128 Deathmatch::start(); 132 129 133 orxout() << "Adding towers for debug..." << endl; 134 135 // Mark corners 136 addTower(0,15); addTower(15,0); 137 138 // Mark diagonal line 139 for (int i = 0 ; i <= 15; i++) 140 addTower(i,i); 141 142 orxout() << "Done" << endl; 130 const int kInitialTowerCount = 3; 131 Coordinate initialTowerCoordinates[kInitialTowerCount] = {{3,2}, {8,5}, {12,10}}; 132 133 for (int i = 0; i < kInitialTowerCount; i++) 134 { 135 Coordinate coordinate = initialTowerCoordinates[i]; 136 addTower(coordinate.x, coordinate.y); 137 } 143 138 144 139 ChatManager::message("Use the console command addTower x y to add towers"); 145 140 146 141 //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player 147 148 142 } 149 143 … … 198 192 newTower->addTemplate(this->center_->getTowerTemplate()); 199 193 200 //this->center_->attach(newTower); 201 202 newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100); 194 newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 75); 203 195 newTower->setGame(this); 204 //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;205 206 // TODO: create Tower mesh207 // TODO: load Tower mesh208 196 } 209 197 … … 229 217 { 230 218 SUPER(TowerDefense, tick, dt); 231 232 static int test = 0;233 if (++test == 10)234 {235 orxout()<< "10th tick." <<endl;236 /*237 for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); it++)238 {239 orxout() << "checking spawnpoint with name " << (*it)->getSpawnClass()->getName() << endl;240 }241 */242 243 //addWaypointsAndFirstEnemy();244 245 }246 219 } 247 220 … … 249 222 250 223 // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL??? 251 224 /* 252 225 void TowerDefense::addWaypointsAndFirstEnemy() 253 226 { … … 283 256 // this->center_->attach(newShip); 284 257 } 285 258 */ 286 259 /* 287 260 void TowerDefense::playerEntered(PlayerInfo* player)
Note: See TracChangeset
for help on using the changeset viewer.