Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2014, 3:58:47 PM (10 years ago)
Author:
erbj
Message:

different models with style

Location:
code/branches/towerdefenseHS14
Files:
1 added
1 deleted
4 edited

Legend:

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

    r10132 r10134  
    2121  include("templates/spaceshipPirate.oxt")
    2222  include("templates/tower.oxt")
    23   include("templates/enemyTowerdefense.oxt")
     23  include("templates/enemytowerdefense.oxt")
    2424?>
    2525
  • code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc

    r10132 r10134  
    158158    // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
    159159
    160     void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){
     160    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr){
    161161
    162162        TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
    163         en1->addTemplate("enemytowerdefense");
    164         en1->setScale(3);
     163
     164        switch(templatenr)
     165        {
     166        case 1 :
     167                en1->addTemplate("enemytowerdefense1");
     168            en1->setScale(3);
     169                break;
     170        case 2 :
     171                        en1->addTemplate("enemytowerdefense2");
     172                en1->setScale(2);
     173                        break;
     174        case 3 :
     175                        en1->addTemplate("enemytowerdefense3");
     176                en1->setScale(1);
     177                        break;
     178        }
     179
    165180        en1->getController();
    166181
     
    283298            if(time>1 && TowerDefenseEnemyvector.size() < 30)
    284299            {
    285                 addTowerDefenseEnemy(path);
     300
     301                addTowerDefenseEnemy(path, rand() %3 +1 );
    286302                time = time-1;
    287303            }
  • code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h

    r10132 r10134  
    5656        std::vector<TowerDefenseEnemy*> TowerDefenseEnemyvector;
    5757
    58         void addTowerDefenseEnemy(std::vector<TDCoordinate*> path);
     58        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
    5959        virtual void start(); //<! The function is called when the gametype starts
    6060        virtual void end();
  • code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10132 r10134  
    4848        float distance = ship.distance(*endpoint);
    4949
    50         orxout() << "distance" << distance << endl;
    5150        if(distance <50){
    52                 orxout() << "ENEMY KILLED!!!!" << endl;
    5351                this->destroy(); }
    5452    }
Note: See TracChangeset for help on using the changeset viewer.