Changeset 9777 for code/branches/invaders/src/modules
- Timestamp:
- Nov 11, 2013, 4:01:44 PM (11 years ago)
- Location:
- code/branches/invaders/src/modules/invader
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/modules/invader/CMakeLists.txt
r9744 r9777 4 4 InvaderCenterPoint.cc 5 5 InvaderShip.cc 6 InvaderEnemy.cc 6 7 InvaderWeapon.cc 7 8 END_BUILD_UNIT -
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 -
code/branches/invaders/src/modules/invader/Invader.h
r9709 r9777 42 42 #include "InvaderCenterPoint.h" 43 43 44 #include "tools/Timer.h" 45 44 46 namespace orxonox 45 47 { … … 56 58 //virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player. 57 59 60 void spawnEnemy(); 61 58 62 void setCenterpoint(InvaderCenterPoint* center) 59 63 { this->center_ = center; } 60 64 private: 61 65 WeakPtr<InvaderCenterPoint> center_; 66 InvaderShip * player; 67 68 ConsoleCommand* console_addEnemy; 69 70 Timer enemySpawnTimer; 62 71 //Context* context; 63 72 }; -
code/branches/invaders/src/modules/invader/InvaderPrereqs.h
r9744 r9777 71 71 class InvaderCenterPoint; 72 72 class InvaderShip; 73 class InvaderEnemy; 73 74 class InvaderWeapon; 74 75 } -
code/branches/invaders/src/modules/invader/InvaderShip.cc
r9744 r9777 52 52 isFireing = false; 53 53 damping = 10; 54 55 54 } 56 55 … … 75 74 ControllableEntity::fire(0); 76 75 76 if (getPosition().x > 30000) 77 { 78 //level++ 79 setPosition(getPosition() - Vector3(30000, 0, 0)); 80 } 81 82 // if ((int(getPosition().x) % 1000) < 5) 83 // { 84 // for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) 85 // it->spawnEnemy(); 86 // } 77 87 78 88 // camera->setOrientation(Vector3::UNIT_X, Degree(0)); … … 81 91 SUPER(InvaderShip, tick, dt); 82 92 } 93 94 83 95 84 96 void InvaderShip::moveFrontBack(const Vector2& value) -
code/branches/invaders/src/modules/invader/InvaderShip.h
r9744 r9777 59 59 virtual void rotatePitch(const Vector2& value){}; 60 60 virtual void rotateRoll(const Vector2& value){}; 61 62 // *InvaderShip getShip(){return this;} 61 63 private: 62 64 Camera* camera;
Note: See TracChangeset
for help on using the changeset viewer.