Changeset 9777 for code/branches/invaders/src/modules/invader/Invader.cc
- Timestamp:
- Nov 11, 2013, 4:01:44 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/modules/invader/Invader.cc
r9709 r9777 42 42 #include "chat/ChatManager.h" 43 43 44 #include "InvaderShip.h"45 44 // ! HACK 46 45 #include "infos/PlayerInfo.h" 47 46 48 47 #include "InvaderCenterPoint.h" 48 #include "InvaderShip.h" 49 50 #include "core/command/ConsoleCommand.h" 49 51 50 52 namespace orxonox … … 55 57 { 56 58 RegisterObject(Invader); 59 this->center_ = 0; 57 60 58 this->c enter_ = 0;61 this->console_addEnemy = createConsoleCommand( "spawnEnemy", createExecutor( createFunctor(&Invader::spawnEnemy, this) ) ); 59 62 //this->context = context; 63 64 enemySpawnTimer.setTimer(2.0f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this))); 60 65 } 61 66 62 67 Invader::~Invader() 63 68 { 69 } 70 71 void Invader::spawnEnemy() 72 { 73 if (player == NULL) 74 { 75 for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it) 76 player = *it; 77 } 78 if (player == NULL) 79 return; 80 81 Pawn* newPawn = new Pawn(this->center_->getContext()); 82 newPawn->addTemplate("enemyinvader"); 83 84 newPawn->setPosition(player->getPosition() + Vector3(1000, 0, 0)); 64 85 } 65 86
Note: See TracChangeset
for help on using the changeset viewer.