Changeset 1855
- Timestamp:
- Sep 28, 2008, 7:10:08 PM (16 years ago)
- Location:
- code/branches/orxonox_tutorial
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/orxonox_tutorial/src/orxonox/OrxonoxPrereqs.h
r1755 r1855 90 90 class SpaceShip; 91 91 class SpaceShipAI; 92 class TutorialShip; 92 93 class WorldEntity; 93 94 -
code/branches/orxonox_tutorial/src/orxonox/OrxonoxStableHeaders.h
r1846 r1855 37 37 #include "util/OrxonoxPlatform.h" 38 38 39 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && !defined(ORXONOX_DISABLE_PCH) 39 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && !defined(ORXONOX_DISABLE_PCH) && 0 40 40 41 41 // including std headers here is useless since they're already precompiled -
code/branches/orxonox_tutorial/src/orxonox/gamestates/GSLevel.cc
r1826 r1855 136 136 // call the loader 137 137 COUT(0) << "Loading level..." << std::endl; 138 startLevel_ = new Level(Settings::getDataPath() + "levels/ sample.oxw");138 startLevel_ = new Level(Settings::getDataPath() + "levels/tutorial.oxw"); 139 139 Loader::open(startLevel_); 140 140 } -
code/branches/orxonox_tutorial/src/orxonox/objects/SpaceShip.cc
r1850 r1855 64 64 SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 65 65 SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 66 SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold);66 //SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold); 67 67 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug); 68 68 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug); … … 258 258 259 259 // START CREATING ADDITIONAL EFFECTS 260 /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 261 this->attachObject(this->backlight_); 262 this->backlight_->setPosition(-2.35, 0, 0.2); 263 this->backlight_->setColour(this->getProjectileColour()); 264 265 this->smoke_ = new ParticleSpawner(); 266 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 267 this->attachObject(this->smoke_); 268 269 this->fire_ = new ParticleSpawner(); 270 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 271 this->attachObject(this->fire_); 272 */ 260 if (this->hasSpecialEffects()) 261 { 262 this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 263 this->attachObject(this->backlight_); 264 this->backlight_->setPosition(-2.35, 0, 0.2); 265 this->backlight_->setColour(this->getProjectileColour()); 266 267 this->smoke_ = new ParticleSpawner(); 268 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 269 this->attachObject(this->smoke_); 270 271 this->fire_ = new ParticleSpawner(); 272 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 273 this->attachObject(this->fire_); 274 } 273 275 // END CREATING ADDITIONAL EFFECTS 274 276 275 if ( this->isExactlyA(Class(SpaceShip)))277 if (!this->isExactlyA(Class(SpaceShipAI))) 276 278 { 277 279 // START of testing crosshair … … 300 302 { 301 303 SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down)."); 302 SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 304 //SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 305 reloadTime_ = 9999999.9f; 303 306 SetConfigValue(testvector_, Vector3()).description("asdfblah"); 304 307 } … … 376 379 COUT(4) << "requesting focus for camera" << std::endl; 377 380 //CameraHandler::getInstance()->requestFocus(cam_); 378 if( this->isExactlyA(Class(SpaceShip))){381 if(!this->isExactlyA(Class(SpaceShipAI))){ 379 382 getFocus(); 380 383 COUT(4) << "getting focus for obj id: " << objectID << std::endl; … … 484 487 485 488 projectile->setObjectMode(0x3); 486 this->timeToReload_ = this-> reloadTime_;489 this->timeToReload_ = this->getReloadTime(); 487 490 } 488 491 -
code/branches/orxonox_tutorial/src/orxonox/objects/SpaceShip.h
r1625 r1855 98 98 void setMoveLateral(float value); 99 99 void doFire(); 100 101 virtual float getReloadTime() { return this->reloadTime_; } 102 virtual bool hasSpecialEffects() { return false; } 100 103 101 104 inline const Vector3& getDir() const -
code/branches/orxonox_tutorial/src/orxonox/objects/TutorialShip.cc
r1852 r1855 45 45 namespace orxonox 46 46 { 47 SetConsoleCommand(TutorialShip, fire, true); 47 SetConsoleCommand(TutorialShip, fire, true).keybindMode(KeybindMode::OnHold); 48 49 CreateFactory(TutorialShip); 48 50 49 51 TutorialShip::TutorialShip() … … 52 54 53 55 // reset variables 56 this->hasSpecialEffects_ = false; 57 58 // set config values 59 this->setConfigValues(); 54 60 } 55 61 … … 65 71 void TutorialShip::setConfigValues() 66 72 { 67 //SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down)."); 68 //SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 69 //SetConfigValue(testvector_, Vector3()).description("asdfblah"); 73 SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 70 74 } 71 75 72 void TutorialShip::registerAllVariables()73 {74 }76 //void TutorialShip::registerAllVariables() 77 //{ 78 //} 75 79 76 80 /** … … 82 86 void TutorialShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) 83 87 { 88 XMLPortParam(TutorialShip, "specialEffects", setSpecialEffects, hasSpecialEffects, xmlelement, mode); 89 90 // Calls SpaceShip::XMLPort 84 91 SUPER(TutorialShip, XMLPort, xmlelement, mode); 92 } 85 93 86 //XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode); 94 bool TutorialShip::hasSpecialEffects() 95 { 96 return this->hasSpecialEffects_; 97 } 98 99 void TutorialShip::setSpecialEffects(bool value) 100 { 101 this->hasSpecialEffects_ = value; 102 } 103 104 /** 105 @brief Returns the weapon reload time. Used virtually by the base class. 106 */ 107 float TutorialShip::getReloadTime() 108 { 109 return this->reloadTime_; 87 110 } 88 111 … … 95 118 void TutorialShip::fire() 96 119 { 120 SpaceShip::getLocalShip()->doFire(); 97 121 } 98 122 } -
code/branches/orxonox_tutorial/src/orxonox/objects/TutorialShip.h
r1852 r1855 50 50 51 51 bool create(); 52 void registerAllVariables();52 //void registerAllVariables(); 53 53 void setConfigValues(); 54 54 void XMLPort(Element& xmlelement, XMLPort::Mode mode); 55 55 void tick(float dt); 56 float getReloadTime(); 57 58 // XML parameter loading 59 bool hasSpecialEffects(); 60 void setSpecialEffects(bool value); 56 61 57 62 // Methods for console commands … … 59 64 60 65 private: 66 float reloadTime_; 67 bool hasSpecialEffects_; 61 68 }; 62 69 } -
code/branches/orxonox_tutorial/visual_studio/vc8/orxonox.vcproj
r1847 r1855 292 292 </File> 293 293 <File 294 RelativePath="..\..\src\orxonox\objects\SpaceShip_backend.cc"295 >296 <FileConfiguration297 Name="Debug|Win32"298 ExcludedFromBuild="true"299 >300 <Tool301 Name="VCCLCompilerTool"302 />303 </FileConfiguration>304 <FileConfiguration305 Name="Release|Win32"306 ExcludedFromBuild="true"307 >308 <Tool309 Name="VCCLCompilerTool"310 />311 </FileConfiguration>312 </File>313 <File314 294 RelativePath="..\..\src\orxonox\objects\SpaceShipAI.cc" 315 295 >
Note: See TracChangeset
for help on using the changeset viewer.