- Timestamp:
- Nov 5, 2014, 3:59:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
r10105 r10109 86 86 #include "graphics/Model.h" 87 87 #include "infos/PlayerInfo.h" 88 89 88 #include "chat/ChatManager.h" 90 89 #include "core/CoreIncludes.h" … … 128 127 void TowerDefense::start() 129 128 { 129 orxout() << "test0" << endl; 130 130 131 Deathmatch::start(); 131 132 … … 139 140 } 140 141 141 ChatManager::message("Use the console command addTower x y to add towers"); 142 orxout() << "test3" << endl; 143 144 //add some TowerDefenseEnemys 145 146 TDCoordinate* coord1 = new TDCoordinate(1,1); 147 /*TDCoordinate* coord2 = new TDCoordinate(10,10); 148 TDCoordinate* coord3 = new TDCoordinate(1,2);*/ 149 std::vector<TDCoordinate> path; 150 path.push_back(*coord1); 151 /*path.push_back(*coord2); 152 path.push_back(*coord3);*/ 153 154 for(int i = 0 ; i <4 ; ++i) 155 { 156 addTowerDefenseEnemy(path); 157 } 158 159 //ChatManager::message("Use the console command addTower x y to add towers"); 142 160 143 161 //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player 144 162 } 145 163 146 void TowerDefense::addEnemy(){} 164 void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate> path){ 165 166 orxout() << "test1" << endl; 167 168 TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext()); 169 // Model* TowerDefenseEnemymodel = new Model(this->center_->getContext()); 170 //TowerDefenseEnemymodel->setMeshSource("crate.mesh"); 171 //TowerDefenseEnemymodel->setPosition(0,0,0); 172 en1->setPosition(path.at(0).get3dcoordinate()); 173 //TowerDefenseEnemymodel->setScale(0.2); 174 175 //en1->attach(TowerDefenseEnemymodel); 176 177 //TowerDefenseEnemyvector.push_back(en1); 178 179 orxout() << "test2" << endl; 180 181 /*for(unsigned int i = 0; i < path.size(); ++i) 182 { 183 en1->addWaypoint(path.at(i)); 184 }*/ 185 186 orxout() << "test6" << endl; 187 188 /*WaypointController *newController = new WaypointController(en1); 189 newController->setAccuracy(3); 190 191 for(int i =0; i < path.size(); ++i) 192 { 193 194 Model *wayPoint = new Model(newController); 195 wayPoint->setMeshSource("crate.mesh"); 196 wayPoint->setPosition(path.at(i).get3dcoordinate()); 197 wayPoint->setScale(0.2); 198 199 newController->addWaypoint(wayPoint); 200 201 }*/ 202 203 } 147 204 148 205 … … 158 215 void TowerDefense::addTower(int x, int y) 159 216 { 160 const TowerCost towerCost = TDDefaultTowerCost;217 /*const TowerCost towerCost = TDDefaultTowerCost; 161 218 162 219 if (!this->hasEnoughCreditForTower(towerCost)) … … 172 229 } 173 230 174 /* 231 175 232 unsigned int width = this->center_->getWidth(); 176 233 unsigned int height = this->center_->getHeight(); 177 */ 234 178 235 179 236 int tileScale = (int) this->center_->getTileScale(); … … 204 261 205 262 newTower->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 75); 206 newTower->setGame(this); 263 newTower->setGame(this);*/ 207 264 } 208 265 … … 227 284 void TowerDefense::tick(float dt) 228 285 { 229 SUPER(TowerDefense, tick, dt);286 //SUPER(TowerDefense, tick, dt); 230 287 } 231 288
Note: See TracChangeset
for help on using the changeset viewer.