Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10608


Ignore:
Timestamp:
Oct 2, 2015, 11:03:31 PM (9 years ago)
Author:
fvultier
Message:

Improved documentation

Location:
code/branches/towerdefenseFabien/src/modules/weapons
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/towerdefenseFabien/src/modules/weapons/IceGunFreezer.cc

    r10606 r10608  
    9292    }   
    9393
     94    /**
     95    @brief
     96        Try to slow down the WorldEntity where this is attached to. It is only possible to slow down a SpaceShip.
     97    */
    9498    void IceGunFreezer::startFreezing()
    9599    {
    96100        WorldEntity* parent = this->getParent();
    97101
     102        // Check if the freezer is attached to a parent and check if the parent is a SpaceShip
    98103        if (parent != NULL && parent->isA(Class(SpaceShip)))
    99104        {
    100105            freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent);
     106            //Slow down the SpaceShip
    101107            freezedSpaceShip_->addSpeedFactor(freezeFactor_);
    102108        }
     
    106112    }
    107113
     114    /**
     115    @brief
     116        This method is called by the timer. It gives back the original engine strength to the hit SpaceShip.
     117    */
    108118    void IceGunFreezer::stopFreezing()
    109119    {
  • code/branches/towerdefenseFabien/src/modules/weapons/IceGunFreezer.h

    r10606 r10608  
    4747    /**
    4848    @brief
    49         blablabla
     49        This is the WorldEntity that gets attached to a victim hit by a IceGunProjectile. It slows down the hit SpaceShip by a defined amount and time.
    5050    @ingroup Weapons
    5151    */
  • code/branches/towerdefenseFabien/src/modules/weapons/projectiles/IceGunProjectile.cc

    r10606 r10608  
    7676
    7777    bool IceGunProjectile::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
    78     {
     78    {       
    7979        bool bCollision = Projectile::collidesAgainst(otherObject, cs, contactPoint);
    8080
    8181        if (bCollision)
    8282        {
     83            // If there was a collision, attach a IceGunFreezer to the hit object.
    8384            IceGunFreezer* freezer = new IceGunFreezer(this->getContext());
    8485            freezer->setFreezeTime(freezeTime_);
     
    8990            freezer->setPosition(Vector3(0,0,0));
    9091            freezer->translate(offset, WorldEntity::World);
     92            // Start the freezing effect.
    9193            freezer->startFreezing();
    9294        }
  • code/branches/towerdefenseFabien/src/modules/weapons/projectiles/IceGunProjectile.h

    r10606 r10608  
    4747    /**
    4848    @brief
    49         The IceGunProjectile is a projectile that may split up into many child projectiles.
     49        The IceGunProjectile is a projectile that attaches a IceGunFreezer to the hit object. This object gets slowed down by the IceGunFreezer.
    5050    @author
    5151        Fabien Vultier
  • code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/IceGun.cc

    r10606 r10608  
    5151        RegisterObject(IceGun);
    5252
     53        // Default values
    5354        this->reloadTime_ = 1.0f;
    5455        this->damage_ = 0.0f;
    5556        this->speed_ = 750.0f;
    56 
    5757
    5858        this->setFreezeTime(3.0);
  • code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/IceGun.h

    r10606 r10608  
    4343    /**
    4444    @brief
    45         A slow ball of lightning.
     45        A Gun that fires ice arrows that slow down any SpaceShip object that gets hit.
    4646    @author
    4747        Fabien Vultier
     
    5656            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5757            virtual void fire();
    58 
    5958           
    6059            inline void setFreezeTime(float freezeTime)
Note: See TracChangeset for help on using the changeset viewer.