Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2014, 4:27:06 PM (9 years ago)
Author:
maxima
Message:

Changes of Hannes. Upgrading towers does not work yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10158 r10159  
    2929
    3030        this->setCollisionType(WorldEntity::Dynamic);
     31        this->td = orxonox_cast<TowerDefense*>(this->getGametype().get());
     32        once_ = false;
    3133
    3234    }
     35
     36    TowerDefenseEnemy::~TowerDefenseEnemy(){this->td->addCredit(20);}
    3337
    3438    void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord)
     
    4953
    5054        //orxout() << "distance" << distance << endl;
    51         if(distance <50){
     55        if(distance < 50 && once_ == false){
     56                this->td->reduceLifes(1);
     57                once_=true;
    5258                orxout() << "ENEMY KILLED!!!!" << endl;
    53                 this->destroy(); }
     59                this->td->buyTower(20);
     60                if (this->td->getLifes()==0)
     61                {
     62                    this->td->end();
     63                }
     64
     65        }
    5466    }
    5567
Note: See TracChangeset for help on using the changeset viewer.