Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2012, 10:00:06 AM (12 years ago)
Author:
mentzerf
Message:
  • Changed waypoint scale so that they are not visible anymore
  • Changed gun position
  • Changed Tower to be a Pawn subclass
  • Fixed glitches of Tower by overriding the orientation and rotation functions

+ Now spawning a few towers in -start

  • Clean up
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc

    r9211 r9236  
    105105                /* Temporary hack to allow the player to add towers */
    106106                this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
    107        
    108                 // Quick hack to test waypoints
    109                 createConsoleCommand( "aw", createExecutor( createFunctor(&TowerDefense::addWaypointsAndFirstEnemy, this) ) );
    110107    }
    111108       
     
    131128        Deathmatch::start();
    132129               
    133         orxout() << "Adding towers for debug..." << endl;
    134                
    135                 // Mark corners
    136                 addTower(0,15); addTower(15,0);
    137                
    138                 // Mark diagonal line
    139                 for (int i = 0 ; i <= 15; i++)
    140                         addTower(i,i);
    141                
    142                 orxout() << "Done" << endl;
     130                const int kInitialTowerCount = 3;
     131                Coordinate initialTowerCoordinates[kInitialTowerCount] = {{3,2}, {8,5}, {12,10}};
     132               
     133                for (int i = 0; i < kInitialTowerCount; i++)
     134                {
     135                        Coordinate coordinate = initialTowerCoordinates[i];
     136                        addTower(coordinate.x, coordinate.y);
     137                }
    143138               
    144139                ChatManager::message("Use the console command addTower x y to add towers");
    145140
    146141                //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player
    147 
    148142        }
    149143       
     
    198192                newTower->addTemplate(this->center_->getTowerTemplate());
    199193
    200                 //this->center_->attach(newTower);
    201 
    202                 newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100);
     194                newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 75);
    203195                newTower->setGame(this);
    204                 //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;
    205                
    206                 // TODO: create Tower mesh
    207                 // TODO: load Tower mesh
    208196        }
    209197       
     
    229217    {
    230218        SUPER(TowerDefense, tick, dt);
    231                
    232         static int test = 0;
    233         if (++test == 10)
    234         {
    235                         orxout()<< "10th tick." <<endl;
    236                         /*
    237                         for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); it++)
    238                         {
    239                                 orxout() << "checking spawnpoint with name " << (*it)->getSpawnClass()->getName() << endl;
    240                         }
    241                         */
    242                        
    243                         //addWaypointsAndFirstEnemy();
    244                        
    245         }
    246219    }
    247220       
     
    249222       
    250223        // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL???
    251        
     224        /*
    252225        void TowerDefense::addWaypointsAndFirstEnemy()
    253226        {
     
    283256//              this->center_->attach(newShip);
    284257        }
    285        
     258        */
    286259        /*
    287260         void TowerDefense::playerEntered(PlayerInfo* player)
Note: See TracChangeset for help on using the changeset viewer.