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
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/towerdefenseHS14/data/levels/towerDefense.oxw

    r10105 r10125  
    2121  include("templates/spaceshipPirate.oxt")
    2222  include("templates/tower.oxt")
     23  include("templates/enemyTowerdefense.oxt")
    2324?>
    2425
     
    7879    <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=3 team=1 >
    7980      <templates>
    80         <Template link=spaceshipassff />
     81        <Template link=enemytowerdefense />
    8182      </templates>
    8283      <controller>
     
    132133    direction="0,0,0"
    133134    collisionType=dynamic
    134     mass=100000>
    135 
    136     </TowerDefenseCenterpoint>
     135    mass=100000
     136    />
    137137
    138138  </Scene>
  • 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.