Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 19, 2014, 4:20:18 PM (9 years ago)
Author:
maxima
Message:
 
File:
1 edited

Legend:

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

    r10126 r10132  
    3434    void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord)
    3535    {
    36         orxout() << "test4" << endl;
    3736        this->Waypointsvector_.push_back(coord);
    38         orxout() << "test5" << endl;
    3937    }
     38
     39
     40    void TowerDefenseEnemy::tick(float dt)
     41    {
     42        SUPER(TowerDefenseEnemy, tick, dt);
     43
     44        //ArtificialController* controller = (ArtificialController*)this->getController();
     45        Vector3 ship = this->getRVWorldPosition();
     46        Vector3* endpoint = new Vector3(500, 700, 150);
     47
     48        float distance = ship.distance(*endpoint);
     49
     50        orxout() << "distance" << distance << endl;
     51        if(distance <50){
     52                orxout() << "ENEMY KILLED!!!!" << endl;
     53                this->destroy(); }
     54    }
     55
    4056/*
    4157    void TowerDefenseEnemy::popWaypoint()
Note: See TracChangeset for help on using the changeset viewer.