Changeset 10368
- Timestamp:
- Apr 16, 2015, 4:24:41 PM (10 years ago)
- Location:
- code/branches/towerdefenseFS15
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseFS15/data/levels/towerDefense.oxw
r10335 r10368 29 29 <Pawn team=1> 30 30 <camerapositions> 31 <CameraPosition position=" -2000,0,1500"/>31 <CameraPosition position="0,0,1500"/> 32 32 </camerapositions> 33 33 </Pawn> … … 59 59 60 60 <!-- Spawns the camera, attached to a crate --> 61 <SpawnPoint team=1 position=" 2000,0,0" pawndesign=centerpointmark />61 <SpawnPoint team=1 position="0,0,0" pawndesign=centerpointmark /> 62 62 <!--TeamSpawnPoint team=1 position="-7,7,4" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /--> 63 63 -
code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc
r10262 r10368 104 104 { 105 105 Pawn* entity = orxonox_cast<Pawn*>(*it); 106 if (!entity || FormationController::sameTeam(t his->getControllableEntity(), entity, this->getGametype()))106 if (!entity || FormationController::sameTeam(turret, entity, this->getGametype())) 107 107 continue; 108 108 tempScore = turret->isInRange(entity); … … 196 196 if(this->isLookingAtTargetNew(Degree(5).valueRadians())) 197 197 { 198 orxout() << target_->getIdentifier()->getName() << " / " << target_->getWorldPosition() << " / " << target_->getHealth() << " / " << target_->getTeam() << " / " << this->getTeam() << " / " << turret->getTeam() << endl; 199 if (target_->getController()) 200 orxout() << target_->getController()->getIdentifier()->getName() << " / " << target_->getController()->getTeam() << endl; 198 201 this->getControllableEntity()->fire(0); 199 202 } -
code/branches/towerdefenseFS15/src/modules/towerdefense/CMakeLists.txt
r10319 r10368 7 7 TDCoordinate.cc 8 8 TowerDefenseEnemy.cc 9 # TowerDefenseSelecter.cc 9 10 10 11 ) -
code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc
r10351 r10368 98 98 RegisterUnloadableClass(TowerDefense); 99 99 100 TowerDefense::TowerDefense(Context* context) : Deathmatch(context)100 TowerDefense::TowerDefense(Context* context) : TeamDeathmatch(context) 101 101 { 102 102 RegisterObject(TowerDefense); … … 108 108 }*/ 109 109 110 selectedPos = new TDCoordinate(0,0); 111 // TowerDefenseSelecter Selecter = new TowerDefenseSelecter(); 110 112 111 113 112 114 this->setHUDTemplate("TowerDefenseHUD"); 115 this->nextwaveTimer_.setTimer(10, false, createExecutor(createFunctor(&TowerDefense::nextwave, this))); 116 this->nextwaveTimer_.stopTimer(); 117 this->waves_ = 0; 118 this->time = 0; 119 this->credit_ = 0; 120 this->lifes_ = 0; 113 121 114 122 //this->stats_ = new TowerDefensePlayerStats(); … … 138 146 { 139 147 140 Deathmatch::start();148 TeamDeathmatch::start(); 141 149 142 150 // Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path … … 220 228 { 221 229 222 Deathmatch::end();230 TeamDeathmatch::end(); 223 231 ChatManager::message("Match is over! Gameover!"); 224 232 … … 330 338 std::vector<TDCoordinate*> path; 331 339 path.push_back(coord1); 332 if(time> 1&& TowerDefenseEnemyvector.size() < 30)340 if(time>=TowerDefenseEnemyvector.size() && TowerDefenseEnemyvector.size() < 30) 333 341 { 334 342 //adds different types of enemys depending on the WaveNumber 335 343 addTowerDefenseEnemy(path, this->getWaveNumber() % 3 +1 ); 336 time = time-1;337 344 } 338 345 … … 359 366 } 360 367 } 368 361 369 //goes thorugh vector to see if an enemy is still alive. if not next wave is launched 362 370 int count= 0; … … 369 377 } 370 378 379 if (count == 0 && !this->nextwaveTimer_.isActive()) 380 this->nextwaveTimer_.startTimer(); 381 382 /* time2 +=dt; 371 383 if(count== 0) 372 384 { 373 time2 +=dt;374 385 if(time2 > 10) 375 386 { … … 380 391 } 381 392 } 382 393 */ 383 394 384 395 } … … 425 436 void TowerDefense::playerEntered(PlayerInfo* player) 426 437 { 427 Deathmatch::playerEntered(player);438 TeamDeathmatch::playerEntered(player); 428 439 429 440 const std::string& message = player->getName() + " entered the game"; … … 433 444 bool TowerDefense::playerLeft(PlayerInfo* player) 434 445 { 435 bool valid_player = Deathmatch::playerLeft(player);446 bool valid_player = TeamDeathmatch::playerLeft(player); 436 447 437 448 if (valid_player) … … 463 474 } 464 475 465 Deathmatch::pawnKilled(victim, killer);476 TeamDeathmatch::pawnKilled(victim, killer); 466 477 } 467 478 -
code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h
r10351 r10368 39 39 #include "TDCoordinate.h" 40 40 #include "towerdefense/TowerDefensePrereqs.h" 41 #include "gametypes/ Deathmatch.h"41 #include "gametypes/TeamDeathmatch.h" 42 42 #include "TowerDefenseEnemy.h" 43 43 #include "util/Output.h" … … 46 46 namespace orxonox 47 47 { 48 class _TowerDefenseExport TowerDefense : public Deathmatch48 class _TowerDefenseExport TowerDefense : public TeamDeathmatch 49 49 { 50 50 public: … … 70 70 void buyTower(int cost){ credit_ -= cost;} 71 71 void addCredit(int credit) { credit_+=credit; } 72 void nextwave(){ waves_++;}72 void nextwave(){ TowerDefenseEnemyvector.clear(); waves_++; time=0;} 73 73 int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; } 74 TDCoordinate* selectedPos; 74 75 75 76 //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); … … 95 96 TowerDefenseCenterpoint *center_; 96 97 float time; 97 float time2;98 // float time2; 98 99 int credit_; 99 100 int waves_; 100 101 int lifes_; 102 Timer nextwaveTimer_; 101 103 102 104 /* handles stats */ -
code/branches/towerdefenseFS15/src/orxonox/controllers/FormationController.cc
r10335 r10368 987 987 } 988 988 989 Team Deathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);989 TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype); 990 990 if (tdm) 991 991 { … … 995 995 if (entity2->getPlayer()) 996 996 team2 = tdm->getTeam(entity2->getPlayer()); 997 }998 999 Mission* miss = orxonox_cast<Mission*>(gametype);1000 if (miss)1001 {1002 if (entity1->getPlayer())1003 team1 = miss->getTeam(entity1->getPlayer());1004 1005 if (entity2->getPlayer())1006 team2 = miss->getTeam(entity2->getPlayer());1007 997 } 1008 998
Note: See TracChangeset
for help on using the changeset viewer.