Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2005, 3:36:18 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the weaponSystem back to the trunk, because it seems safe
merged with command:
svn merge -r 4847:HEAD branches/weaponSystem/ trunk/
conflict in file src/world-entities/weapons/weapon.h resolved in favor of the weaponSystem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r4836 r4885  
    5050
    5151  this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);
    52   this->idleTime = 0.2f;
    5352  this->leftRight = leftRight;
    5453
     
    9291      this->animation3->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    9392    }
    94 
     93/*
    9594  this->fireSound = (SoundBuffer*)ResourceManager::getInstance()->load("sound/shot1.wav", WAV);
    9695  this->weaponSource = new SoundSource(this->fireSound, this);
    97   this->weaponSource->setRolloffFactor(.1);
     96  this->weaponSource->setRolloffFactor(.1);*/
    9897  Projectile* p = new TestBullet(this);
    99 //  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
     98
     99  //  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
    100100  //ObjectManager::getInstance()->debug();
     101
     102  this->setStateDuration(WS_SHOOTING, .2);
     103
     104  this->energy = 100;
     105  this->minCharge = 2;
     106
     107  this->setActionSound(WA_SHOOT, "sound/shot1.wav");
    101108}
    102109
     
    145152void TestGun::fire()
    146153{
    147   if( !this->hasWeaponIdleTimeElapsed())
    148     {
    149       this->weaponIdle();
    150       return;
    151     }
    152 
    153     Projectile* pj =  new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
    154   weaponSource->play();
     154  this->energyLoaded -= this->minCharge;
     155  Projectile* pj =  new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
     156//  weaponSource->play();
    155157
    156158  pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset);
     
    158160  pj->setVelocity(this->getVelocity());
    159161  State::getWorldEntityList()->add(pj);
    160   this->localTime = 0;
    161162
    162163  this->animation1->replay();
     
    184185void TestGun::destroy ()
    185186{}
    186 
    187 
    188 /**
    189  *  tick signal for time dependent/driven stuff
    190 */
    191 void TestGun::tick (float time)
    192 {
    193   this->localTime += time;
    194 }
    195187
    196188
Note: See TracChangeset for help on using the changeset viewer.