Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2014, 11:53:34 PM (10 years ago)
Author:
maxima
Message:

Enemies use the new template enemytowerdefense

Location:
code/branches/towerdefenseHS14/src/modules/towerdefense
Files:
2 edited

Legend:

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

    r10106 r10125  
    3636        coord->x= (x-8) * tileScale;
    3737        coord->y= (y-8) * tileScale;
    38         coord->z=0;
     38        coord->z=100;
    3939
    4040        return *coord;
  • code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc

    r10123 r10125  
    148148
    149149        TDCoordinate* coord1 = new TDCoordinate(1,1);
    150         TDCoordinate* coord2 = new TDCoordinate(1,1);
    151         TDCoordinate* coord3 = new TDCoordinate(1,2);
     150        TDCoordinate* coord2 = new TDCoordinate(1,3);
     151        TDCoordinate* coord3 = new TDCoordinate(10,3);
    152152
    153153
     
    163163
    164164
    165         for(int i = 0 ; i < 20 ; ++i)
     165        for(int i = 0 ; i < 1 ; ++i)
    166166        {
    167167                addTowerDefenseEnemy(path);
     
    175175    }
    176176
     177    // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
     178
    177179    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){
    178180
     
    180182
    181183        TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
    182         en1->addTemplate("spaceshipassff");
    183         /*en1->setInitialHealth(1000);
     184        en1->addTemplate("enemytowerdefense");
     185        en1->setScale(3);
     186
     187
     188        /*en1->setInitialHealth(1000);
    184189        en1->setHealth(1000);
    185190        en1->setMaxHealth(1000);
     
    190195
    191196
    192         Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
    193 
    194         TowerDefenseEnemymodel->setMeshSource("cube.mesh");
    195 
    196         TowerDefenseEnemymodel->setPosition(0,0,75);
    197         en1->setPosition(0,0,150);
    198         TowerDefenseEnemymodel->setScale(10);
    199 
    200 
    201         en1->attach(TowerDefenseEnemymodel);
     197        //Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
     198
     199        //TowerDefenseEnemymodel->setMeshSource("cube.mesh");
     200
     201        //TowerDefenseEnemymodel->setPosition(0,0,75);
     202        en1->setPosition(path.at(0)->get3dcoordinate());
     203
     204        //TowerDefenseEnemymodel->setScale(10);
     205
     206
     207        //en1->attach(TowerDefenseEnemymodel);
    202208
    203209        TowerDefenseEnemyvector.push_back(en1);
Note: See TracChangeset for help on using the changeset viewer.