- Timestamp:
- Dec 3, 2014, 5:18:24 PM (10 years ago)
- Location:
- code/branches/surfaceraceHS14
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw
r10135 r10152 26 26 27 27 <Scene 28 ambientlight = " 2.0, 2.0, 2.0"28 ambientlight = "1.0, 1.0, 1.0" 29 29 skybox = "Orxonox/skyBoxClouds" 30 30 negativeWorldRange = "-100000, -100000, -100000" … … 46 46 47 47 <DodgeRaceCenterPoint name=invadercenter /> 48 49 50 <StaticEntity position="1500,40,50" direction="0,0,0" scale="1" collisionType=static mass=0 friction=0.01 > 48 49 <StaticEntity position="0,-50,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 > 51 50 <attached> 52 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" /> 53 </attached> 54 55 <collisionShapes> 56 <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" /> 57 </collisionShapes> 58 59 </StaticEntity> 60 <StaticEntity position="4500,50,-30" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 > 61 <attached> 62 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,40,50" /> 63 </attached> 64 65 <collisionShapes> 66 <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" /> 67 </collisionShapes> 68 69 </StaticEntity> 70 71 <StaticEntity position="0,-10,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 > 72 <attached> 73 <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="100000,2,100000" /> 51 <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" /> 74 52 </attached> 75 53 -
code/branches/surfaceraceHS14/data/levels/templates/DodgeRacePattern.oxt
r10139 r10152 1 <Template name=DodgeRaceCube0 2>1 <Template name=DodgeRaceCube01> 2 2 3 < StaticEntity position="0,0,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 >3 <DodgeRaceCube position="0,0,0" direction="0,0,0" scale="1" collisionType=dynamic mass=1 friction=0.01 > 4 4 <attached> 5 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="600,50,50" /> 6 <Model position="0,0,950" mesh="blackcube.mesh" scale3D="600,50,50" /> 7 <Model position="800,0,50" mesh="blackcube.mesh" scale3D="100,50,100" /> 8 <Model position="800,0,850" mesh="blackcube.mesh" scale3D="100,50,100" /> 9 <Model position="850,0,250" mesh="blackcube.mesh" scale3D="50,40,100" /> 10 <Model position="850,0,450" mesh="blackcube.mesh" scale3D="50,40,100" /> 11 <Model position="850,0,650" mesh="blackcube.mesh" scale3D="50,40,100" /> 5 <Model position="700,0,50" mesh="CuboidBody.mesh" scale3D="300,50,50" /> 6 <Model position="700,0,1150" mesh="CuboidBody.mesh" scale3D="300,50,50" /> 7 <Model position="1200,0,200" mesh="CuboidBody.mesh" scale3D="100,50,100" /> 8 <Model position="1200,0,1000" mesh="CuboidBody.mesh" scale3D="100,50,100" /> 9 <Model position="1250,-10,430" mesh="CuboidBody.mesh" scale3D="50,40,30" /> 10 <Model position="1250,-10,600" mesh="CuboidBody.mesh" scale3D="50,40,30" /> 11 <Model position="1250,-10,770" mesh="CuboidBody.mesh" scale3D="50,40,30" /> 12 <Model position="1650,0,350" mesh="CuboidBody.mesh" scale3D="50,50,150" /> 13 <Model position="1650,0,850" mesh="CuboidBody.mesh" scale3D="50,50,150" /> 14 <Model position="2100,0,150" mesh="CuboidBody.mesh" scale3D="100,50,150" /> 15 <Model position="2100,0,1050" mesh="CuboidBody.mesh" scale3D="100,50,150" /> 16 <Model position="2150,0,600" mesh="CuboidBody.mesh" scale3D="50,50,100" /> 12 17 </attached> 13 18 14 19 <collisionShapes> 15 <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" /> 20 <BoxCollisionShape position="700,0,50" halfExtents="300,50,50" /> 21 <BoxCollisionShape position="700,0,1150" halfExtents="300,50,50" /> 22 <BoxCollisionShape position="1200,0,200" halfExtents="100,50,100" /> 23 <BoxCollisionShape position="1200,0,1000" halfExtents="100,50,100" /> 24 <BoxCollisionShape position="1250,-10,430" halfExtents="50,40,30" /> 25 <BoxCollisionShape position="1250,-10,600" halfExtents="50,40,30" /> 26 <BoxCollisionShape position="1250,-10,770" halfExtents="50,40,30" /> 27 <BoxCollisionShape position="1650,0,350" halfExtents="50,50,150" /> 28 <BoxCollisionShape position="1650,0,850" halfExtents="50,50,150" /> 29 <BoxCollisionShape position="2100,0,150" halfExtents="100,50,150" /> 30 <BoxCollisionShape position="2100,0,1050" halfExtents="100,50,150" /> 31 <BoxCollisionShape position="2150,0,600" halfExtents="50,50,100" /> 16 32 </collisionShapes> 17 </ StaticEntity>33 </DodgeRaceCube> 18 34 19 35 </Template> 20 36 21 <Template name=DodgeRaceCube0 1>37 <Template name=DodgeRaceCube02> 22 38 23 < StaticEntity position="0,0,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 >39 <DodgeRaceCube position="0,0,0" direction="0,0,0" scale="1" collisionType=dynamic mass=1 friction=0.01 > 24 40 <attached> 25 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,100" /> 26 <Model position="50,0,150" mesh="blackcube.mesh" scale3D="50,50,50" /> 27 <Model position="40,0,-155" mesh="blackcube.mesh" scale3D="50,50,50" /> 41 <Model position="450,0,300" mesh="CuboidBody.mesh" scale3D="50,50,300" /> 42 <Model position="950,0,850" mesh="CuboidBody.mesh" scale3D="50,50,350" /> 43 <Model position="1350,0,200" mesh="CuboidBody.mesh" scale3D="50,50,200" /> 44 <Model position="1350,0,700" mesh="CuboidBody.mesh" scale3D="50,50,100" /> 45 <Model position="1750,0,350" mesh="CuboidBody.mesh" scale3D="50,50,350" /> 46 <Model position="2000,0,1000" mesh="CuboidBody.mesh" scale3D="100,50,100" /> 47 <Model position="1650,0,1150" mesh="CuboidBody.mesh" scale3D="450,50,50" /> 28 48 </attached> 29 49 30 50 <collisionShapes> 31 <BoxCollisionShape position="0,1000,0" halfExtents="1,1,1" /> 51 <BoxCollisionShape position="450,0,300" halfExtents="50,50,300" /> 52 <BoxCollisionShape position="950,0,850" halfExtents="50,50,350" /> 53 <BoxCollisionShape position="1350,0,200" halfExtents="50,50,200" /> 54 <BoxCollisionShape position="1350,0,700" halfExtents="50,50,100" /> 55 <BoxCollisionShape position="1750,0,350" halfExtents="50,50,350" /> 56 <BoxCollisionShape position="2000,0,1000" halfExtents="100,50,100" /> 57 <BoxCollisionShape position="1650,0,1150" halfExtents="450,50,50" /> 32 58 </collisionShapes> 33 </ StaticEntity>59 </DodgeRaceCube> 34 60 35 61 </Template> -
code/branches/surfaceraceHS14/src/modules/dodgerace2/CMakeLists.txt
r10118 r10152 3 3 DodgeRaceCenterPoint.cc 4 4 DodgeRaceShip.cc 5 DodgeRaceCube.cc 5 6 DodgeRaceHUDinfo.cc 6 7 ) -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc
r10135 r10152 34 34 #include "DodgeRace.h" 35 35 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header! 36 #include "DodgeRaceCube.h" 36 37 37 38 namespace orxonox … … 59 60 b_combo = false; 60 61 counter = 0; 62 pattern = 1; 61 63 lastPosition = 0; 62 64 // spawn enemy every 3.5 seconds … … 94 96 lastPosition = currentPosition; 95 97 96 if(counter >= 5000) 98 for(int i=0; i< cubeList.size();i++) 99 { 100 if(cubeList.at(i)->getPosition().x < currentPosition-3000) 101 { 102 cubeList.at(i)->destroy(); 103 cubeList.erase(cubeList.begin()+i); 104 } 105 } 106 107 if(counter >= 3000) 97 108 { 98 109 counter = 0; 99 110 100 WeakPtr<StaticEntity> stentity = new StaticEntity(this->center_->getContext()); //this->center_->getContext() 101 stentity->addTemplate("DodgeRaceCube01"); 102 103 stentity->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, 0)); 104 //stentity->setScale3D(50,50,50); 111 for(int i = 0; i<6; i++) 112 { 113 WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext()); 114 cubeList.push_back(cube); 115 switch(pattern) 116 { 117 case 1: cube->addTemplate("DodgeRaceCube01"); 118 break; 119 case 2: cube->addTemplate("DodgeRaceCube02"); 120 break; 121 122 } 123 124 cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, -3600 + (i*1200))); 125 //stEntity->setScale3D(50,50,50); 126 } 127 128 129 pattern %= 2; 130 pattern ++; 131 105 132 } 133 106 134 } 107 135 SUPER(DodgeRace, tick, dt); … … 166 194 void DodgeRace::start() 167 195 { 196 orxout() << "start function called." << endl; 168 197 init(); 198 for(int i=0; i< cubeList.size();i++) 199 { 200 cubeList.at(i)->destroy(); 201 cubeList.erase(cubeList.begin()+i); 202 203 } 204 cubeList.clear(); 169 205 // Set variable to temporarily force the player to spawn. 170 206 this->bForceSpawn_ = true; -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h
r10135 r10152 51 51 #include "gamestates/GSLevel.h" 52 52 #include "chat/ChatManager.h" 53 #include <vector> 53 54 54 55 // ! HACK … … 96 97 int multiplier; 97 98 int counter; 99 int pattern; 98 100 int currentPosition; 99 101 int lastPosition; … … 102 104 WeakPtr<DodgeRaceShip> getPlayer(); 103 105 WeakPtr<DodgeRaceShip> player; 106 std::vector<DodgeRaceCube*> cubeList; 104 107 void toggleShowLevel(){bShowLevel = !bShowLevel;} 105 108 void addPoints(int numPoints); -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRacePrereqs.h
r10118 r10152 71 71 class DodgeRaceCenterPoint; 72 72 class DodgeRaceShip; 73 class DodgeRaceCube; 73 74 //class DodgeRaceEnemy; 74 75 //class DodgeRaceEnemyShooter; -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc
r10135 r10152 75 75 velocity.y = 0; 76 76 // restart if game ended 77 /* 77 78 if (getGame()) 78 79 if (getGame()->bEndGame) … … 80 81 getGame()->start(); 81 82 return; 82 } 83 }*/ 83 84 } 84 85 /*
Note: See TracChangeset
for help on using the changeset viewer.