Changeset 12153 for code/branches/TowerDefense_HS18/src
- Timestamp:
- Dec 5, 2018, 12:04:18 PM (6 years ago)
- Location:
- code/branches/TowerDefense_HS18/src/modules/towerdefense
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/TowerDefense_HS18/src/modules/towerdefense/TowerDefense.cc
r12125 r12153 157 157 en1->addTemplate("enemytowerdefense1"); 158 158 en1->setScale(3); 159 en1->setHealth(en1->getHealth() + this->getWaveNumber()*4); 159 en1->setHealth(en1->getHealth() + this->getWaveNumber()*1/3*0.5*(en1->getHealth())); 160 en1->setShieldHealth(en1->getShieldHealth() + this->getWaveNumber()*1/3*0.5*(en1->getShieldHealth())); 160 161 break; 161 162 … … 163 164 en1->addTemplate("enemytowerdefense2"); 164 165 en1->setScale(2); 165 en1->setHealth(en1->getHealth() + this->getWaveNumber()* 4);166 en1->setHealth(en1->getHealth() + this->getWaveNumber()*1/3*0.3*(en1->getHealth())); 166 167 break; 167 168 … … 169 170 en1->addTemplate("enemytowerdefense3"); 170 171 en1->setScale(1); 171 en1->setHealth(en1->getHealth() + this->getWaveNumber()*4); 172 en1->setHealth(en1->getHealth() + this->getWaveNumber()*1/3*0.2*(en1->getHealth())); 173 en1->setShieldHealth(en1->getShieldHealth() + this->getWaveNumber()*1/3*0.5*(en1->getShieldHealth())); 172 174 break; 173 175 } … … 308 310 ctrl->destroy(); 309 311 it = enemies_.erase(it); 310 addCredit(1); 312 313 int currentType = this->getWaveNumber() % 3 + 1; 314 switch (currentType){ //Entscheidet, wie viele Credits vergeben werden sollen 315 case 1: //currently boss wave 316 addCredit(100); 317 if (this->getLifes() <= 90) 318 { 319 this->setLifes(this->getLifes() + 10); 320 } 321 break; 322 323 case 2: //currently mass wave 324 addCredit(5); 325 break; 326 327 case 3: //currently moderate wave 328 addCredit(10); 329 break; 330 } 311 331 } 312 332 else … … 340 360 timeSinceLastSpawn_ -= 1.0; 341 361 -- waveSize_; 342 addTowerDefenseEnemy(this->getWaveNumber() % 3 + 1); 362 addTowerDefenseEnemy(this->getWaveNumber() % 3 + 1); //Gegnertyp rotiert durch die 3 moeglichen, er beginnt bei Typ 2!!! 343 363 } 344 364 else if (timeUntilNextWave_ <= 0.0 && waveSize_ <= 0) 345 365 { 366 int currentType = this->getWaveNumber() % 3 + 1; 346 367 //New wave 347 368 ++ waveNumber_; … … 349 370 350 371 timeUntilNextWave_ = waveNumber_+20.0f; 351 waveSize_ = waveNumber_+5; 372 // Entscheidung, wie gross die einzelnen waves sein sollen. 373 switch (currentType){ 374 case 1: //currently boss wave 375 waveSize_ = waveNumber_+10; 376 break; 377 378 case 2: //currently mass wave 379 waveSize_ = (waveNumber_+10)/2; 380 break; 381 382 case 3: //currently moderate wave 383 waveSize_ = 1; 384 break; 385 } 352 386 } 353 387 … … 361 395 std::string fields = center_->getFields(); 362 396 int pos = 0; 363 for (int j = 15; j >= 0; --j) 364 { 365 for (int i = 0; i < 16; ++i)397 for (int j = 15; j >= 0; --j) //Vertical number of rows 398 { 399 for (int i = 0; i <= 15; ++i) //Horizontal number of rows 366 400 { 367 401 coord.Set(i,j); -
code/branches/TowerDefense_HS18/src/modules/towerdefense/TowerDefenseController.cc
r12137 r12153 81 81 Engine* engine = ship->getEngine(0); 82 82 if(engine != nullptr) { 83 speed = engine->getMaxSpeedFront(); //Geschwindigkeit wird ausgelesen84 orxout() << "shiftshan" << endl; 83 speed = engine->getMaxSpeedFront(); //Geschwindigkeit sollte ausgelesen werden, wird momentan aber noch NICHT -> ein Fehler mit den Engines 84 85 85 } else { 86 speed = 100; 87 orxout() << "shiftshannonen" << endl; 86 speed = 200; //Momentan wird hiermit die Geschwindigkeit ALLER Schiffe gesetzt! 88 87 } 89 88 … … 127 126 this->getControllableEntity()->setPosition(offset_ + newPosition); 128 127 this->getControllableEntity()->lookAt(this->getControllableEntity()->getPosition() + newDirection); 129 128 this->getControllableEntity()->setVelocity(speed * newDirection); 130 129 } 131 130
Note: See TracChangeset
for help on using the changeset viewer.