Changeset 12110
- Timestamp:
- Nov 21, 2018, 11:45:27 AM (6 years ago)
- Location:
- code/branches/WorldMap_HS18
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw
r12101 r12110 22 22 <Template link=lodtemplate_default /> 23 23 </templates> 24 25 26 24 27 <?lua include("includes/notifications.oxi") ?> 25 28 … … 28 31 skybox = "Orxonox/Starbox" 29 32 > 33 <StoryModeController position="0,0,0" collisionType="dynamic"> 30 34 35 <attached> 36 <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="true" /> 37 </attached> 31 38 39 <collisionShapes> 40 <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" /> 41 </collisionShapes> 42 </StoryModeController> 43 <!-- <MovableEntity> 44 <attached> 45 <StaticEntity name=asdfasdf figureTemplate=smCont> 46 <attached> 47 </attached> 48 </StaticEntity> 49 </attached> 50 </MovableEntity> --> 51 32 52 <StaticEntity position="0,0,0" direction="0,0,-1" > 33 53 <attached> … … 36 56 37 57 38 <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="true" orientation="-0.015,0.091,0.038,-0.995"/> 39 <Model position="600,370,0" mesh="Coordinates.mesh" scale=10 /> 58 <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="false" orientation="-0.015,0.091,0.038,-0.995"/> 40 59 <Billboard colour="1,1,0.05" position="600,370,-80" material="Flares/lensflare" scale=4.5 /> 41 60 42 61 43 62 <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100 visible="false"/> 44 <Model position="50,300,-250" mesh="assff.mesh" scale=20 visible=" true" orientation="-0.015,0.091,0.038,-0.995"/>63 <Model position="50,300,-250" mesh="assff.mesh" scale=20 visible="false" orientation="-0.015,0.091,0.038,-0.995"/> 45 64 <Billboard colour="1,1,0.05" position="100,350,-330" material="Flares/lensflare" scale=4.5 /> 46 65 47 <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 />66 <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 visible="false"/> 48 67 <Billboard colour="1,1,0.05" position="-600,250,-580" material="Flares/lensflare" scale=5 /> 49 68 … … 69 88 </StaticEntity> 70 89 90 91 71 92 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 72 93 -
code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc
r11781 r12110 38 38 #include "graphics/Camera.h" 39 39 #include "graphics/ParticleSpawner.h" 40 #include "worldentities/pawns/SpaceShip.h" 40 41 #include <math.h> 41 42 #include <ctime> -
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
r12106 r12110 6 6 } 7 7 8 SMCoord::~SMCoord() { 9 10 } 11 8 12 SMCoord::SMCoord(int x) { 9 13 set(x); … … 11 15 12 16 void SMCoord::set(int index) { 17 if(index<0) return; 18 if(index>8) return; 13 19 this->index = index; 20 } 21 22 Vector3 SMCoord::get3dcoordinate() { 23 Vector3 coord; 24 switch(this->index) 25 { 26 case 0: 27 coord.x= 550; 28 coord.y = 300; 29 coord.z = 0; 30 break; 31 case 1: 32 coord.x= 100; 33 coord.y = 350; 34 coord.z = -250; 35 break; 36 case 2: 37 coord.x= -600; 38 coord.y = 250; 39 coord.z = -500; 40 break; 41 case 3: 42 coord.x= -1000; 43 coord.y = 50; 44 coord.z = -750; 45 break; 46 case 4: 47 coord.x= -900; 48 coord.y = -400; 49 coord.z = -1000; 50 break; 51 case 5: 52 coord.x= -500; 53 coord.y = -700; 54 coord.z = -1250; 55 break; 56 case 6: 57 coord.x= 0; 58 coord.y = 900; 59 coord.z = -1500; 60 break; 61 case 7: 62 coord.x= 700; 63 coord.y = -1100; 64 coord.z = -1750; 65 break; 66 case 8: 67 coord.x= 1500; 68 coord.y = 1300; 69 coord.z = -2000; 70 break; 71 default: 72 coord.x= 0; 73 coord.y = 0; 74 coord.z = 0; 75 } 76 return coord; 14 77 } 15 78 -
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h
r12106 r12110 13 13 SMCoord(); 14 14 SMCoord(int x); 15 virtualvoid set(int index);15 void set(int index); 16 16 virtual int getIndex(); 17 virtual Vector3 get3dcoordinate(); 18 virtual ~SMCoord(); 19 17 20 18 21 private: -
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
r12106 r12110 31 31 #include "core/CoreIncludes.h" 32 32 #include "worldentities/ControllableEntity.h" 33 #include "graphics/Camera.h" 33 34 #include "SMCoord.h" 34 35 #include "core/XMLPort.h" 35 36 namespace orxonox 36 37 { 37 38 RegisterClass(StoryModeController); 38 39 39 StoryModeController::StoryModeController(Context* context) : ControllableEntity(context)40 StoryModeController::StoryModeController(Context* context) : SpaceShip(context) 40 41 { 41 42 RegisterObject(StoryModeController); 42 43 float time_; 43 moveForward_=false; 44 selectedPos_ = new SMCoord(0); 45 moveForward_= false; 44 46 moveBackward_=false; 45 47 boostPressed_=false; 46 setPosition(0); 48 49 47 50 48 51 } 49 50 52 StoryModeController::~StoryModeController() 51 53 { 52 54 delete selectedPos_; 55 selectedPos_ = nullptr; 53 56 54 57 } 55 58 56 59 void StoryModeController::updatePosition(){ 57 60 Vector3 pos = selectedPos_->get3dcoordinate(); 61 setPosition(pos); 58 62 } 59 void StoryModeController::set Position(int index){60 63 void StoryModeController::setLocation(int index){ 64 selectedPos_->set(index); 61 65 } 62 66 … … 64 68 { 65 69 orxout(internal_error) << "Hi" << endl; 66 SUPER(StoryModeController, tick, dt); 67 time_ +=dt; 70 SUPER(StoryModeController, tick, dt); 71 time_ +=dt; 72 73 if(moveForward_ == true){ 74 moveForward_ = false; 75 selectedPos_->set(selectedPos_->getIndex()+1); 76 updatePosition(); 77 } 78 if(moveBackward_ == true){ 79 moveBackward_ = false; 80 selectedPos_->set(selectedPos_->getIndex()-1); 81 updatePosition(); 82 } 83 if(boostPressed_ == true){ 84 boostPressed_ = false; 85 chooseGame(); 86 } 68 87 69 88 … … 72 91 void StoryModeController::moveFrontBack(const Vector2& value) 73 92 { 74 93 orxout(internal_error) << "moveFrontBack" << endl; 75 94 } 95 96 void StoryModeController::chooseGame() 97 { 98 //findLevel(selectedPos_->getIndex()); 99 } 100 101 76 102 void StoryModeController::moveRightLeft(const Vector2& value) 77 103 { … … 87 113 } 88 114 89 void StoryModeController::rotateYaw(const Vector2& value){} 90 void StoryModeController::rotatePitch(const Vector2& value){} 91 void StoryModeController::rotateRoll(const Vector2& value){} 115 void StoryModeController::rotateYaw(const Vector2& value){ 116 orxout(internal_error) << "RightLeft" << endl; 117 } 118 void StoryModeController::rotatePitch(const Vector2& value){ 119 orxout(internal_error) << "RightLeft" << endl; 120 } 121 void StoryModeController::rotateRoll(const Vector2& value){ 122 orxout(internal_error) << "RightLeft" << endl; 123 } 92 124 void StoryModeController::fire(unsigned int a){} 93 125 void StoryModeController::fired(unsigned int b){} 94 126 void StoryModeController::boost(bool bBoost){ 127 orxout(internal_error) << "Boost" << endl; 95 128 boostPressed_ = true; 96 129 } -
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
r12106 r12110 36 36 #include "worldentities/ControllableEntity.h" 37 37 #include "worldentities/pawns/SpaceShip.h" 38 #include "SMCoord.h" 38 39 39 40 namespace orxonox 40 41 { 41 class _OrxonoxExport StoryModeController : public ControllableEntity42 class _OrxonoxExport StoryModeController : public SpaceShip 42 43 { 43 44 public: … … 54 55 virtual void fired(unsigned int firemode) override; 55 56 virtual void boost(bool bBoost) override; 56 virtual void set Position(int index);57 virtual void setLocation(int index); 57 58 bool moveRight_ ; 58 59 bool moveLeft_ ; 60 SMCoord* selectedPos_; 59 61 private: 60 62 virtual void updatePosition(); … … 63 65 bool moveBackward_; 64 66 bool boostPressed_; 67 virtual void chooseGame(); 65 68 66 69 };
Note: See TracChangeset
for help on using the changeset viewer.