- Timestamp:
- Nov 5, 2014, 3:59:18 PM (10 years ago)
- Location:
- code/branches/towerdefenseHS14/src/modules/towerdefense
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/CMakeLists.txt
r10106 r10109 7 7 TowerDefensePlayerStats.cc 8 8 TDCoordinate.cc 9 Enemy.cc9 TowerDefenseEnemy.cc 10 10 11 11 ) -
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 -
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
r10105 r10109 40 40 #include "towerdefense/TowerDefensePrereqs.h" 41 41 #include "gametypes/Deathmatch.h" 42 #include "TowerDefenseEnemy.h" 43 #include "util/Output.h" 44 42 45 43 46 #include "TowerDefensePlayerStats.h" … … 51 54 virtual ~TowerDefense(); 52 55 53 void addEnemy(); 56 std::vector<TowerDefenseEnemy*> TowerDefenseEnemyvector; 57 58 void addTowerDefenseEnemy(std::vector<TDCoordinate> path); 54 59 virtual void start(); //<! The function is called when the gametype starts 55 60 virtual void end(); -
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefensePrereqs.h
r10091 r10109 70 70 class TowerDefenseHUDController; 71 71 class TowerDefensePlayerStats; 72 class TowerDefenseEnemy; 73 class TDCoordinate; 72 74 class TowerTurret; 73 75 }
Note: See TracChangeset
for help on using the changeset viewer.