Changeset 10135
- Timestamp:
- Nov 26, 2014, 3:59:37 PM (10 years ago)
- Location:
- code/branches/surfaceraceHS14
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw
r10128 r10135 15 15 include("templates/spaceshipDodgeRace.oxt") 16 16 include("templates/enemyInvader.oxt") 17 include("templates/DodgeRacePattern.oxt") 17 18 include("overlays/InvaderHUD.oxo") 18 19 ?> … … 38 39 39 40 <!-- <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"/> --> 40 <Light type=directional position=" 1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />41 <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" /> 41 42 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=DodgeRaceShip pawndesign=spaceshipdodgerace /> 42 43 … … 47 48 48 49 49 <StaticEntity position="1500, 0,50" direction="0,0,0" scale="1" collisionType=static mass=0 friction=0.01 >50 <StaticEntity position="1500,40,50" direction="0,0,0" scale="1" collisionType=static mass=0 friction=0.01 > 50 51 <attached> 51 52 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" /> … … 57 58 58 59 </StaticEntity> 59 <StaticEntity position="4500, 0,-30" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 >60 <StaticEntity position="4500,50,-30" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 > 60 61 <attached> 61 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50, 50,50" />62 <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,40,50" /> 62 63 </attached> 63 64 64 65 <collisionShapes> 65 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" /> 74 </attached> 75 76 <collisionShapes> 77 <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" /> 66 78 </collisionShapes> 67 79 -
code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt
r10128 r10135 69 69 <DodgeRaceShip> 70 70 <camerapositions> 71 <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true /> 71 <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true /> 72 <CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true /> 72 73 <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true /> 73 74 </camerapositions> -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc
r10124 r10135 58 58 multiplier = 1; 59 59 b_combo = false; 60 60 counter = 0; 61 lastPosition = 0; 61 62 // spawn enemy every 3.5 seconds 62 63 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this))); … … 81 82 toggleShowLevel(); 82 83 showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this))); 84 } 85 86 void DodgeRace::tick(float dt) 87 { 88 if (getPlayer() != NULL) 89 { 90 //WeakPtr<DodgeRaceShip> ship = getPlayer(); 91 92 currentPosition = getPlayer()->getWorldPosition().x; 93 counter = counter + (currentPosition - lastPosition); 94 lastPosition = currentPosition; 95 96 if(counter >= 5000) 97 { 98 counter = 0; 99 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); 105 } 106 } 107 SUPER(DodgeRace, tick, dt); 83 108 } 84 109 -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h
r10124 r10135 74 74 virtual void end(); 75 75 76 virtual void tick(float dt); 77 76 78 void levelUp(); 77 79 … … 93 95 int lives; 94 96 int multiplier; 97 int counter; 98 int currentPosition; 99 int lastPosition; 95 100 96 101 private: -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc
r10128 r10135 42 42 RegisterObject(DodgeRaceShip); 43 43 44 speed = 500;44 speed = 800; 45 45 isFireing = false; 46 46 damping = 10; … … 82 82 } 83 83 } 84 /* 84 85 if (pos.z + dist_x > 42*2.5 || pos.z + dist_x < -42*3) 85 velocity.x = 0; 86 { 87 velocity.x = 0; 88 } 89 */ 86 90 pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt; 87 91 } … … 99 103 if (camera != NULL) 100 104 { 101 camera->setPosition(Vector3(-pos.z, -posforeward, 0));105 // camera->setPosition(Vector3(-pos.z, -posforeward, 0)); 102 106 camera->setOrientation(Vector3::UNIT_Z, Degree(0)); 103 107 } … … 145 149 void DodgeRaceShip::boost(bool bBoost) 146 150 { 147 isFireing = bBoost;151 //isFireing = bBoost; 148 152 } 149 153 150 154 inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 151 155 { 156 /* 152 157 if (otherObject != NULL && lastEntity != otherObject) 153 158 { 154 159 lastEntity = otherObject; 155 160 removeHealth(20); 156 //this->death();157 161 } 162 */ 158 163 164 165 this->death(); 159 166 return false; 160 167 }
Note: See TracChangeset
for help on using the changeset viewer.