Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 4, 2012, 2:51:44 PM (13 years ago)
Author:
mentzerf
Message:
  • Fixed size of oxw stuff.

+ Added tileScale to TowerDefenseCenterpoint to store the scale of the oxw

  • Removed WaypointController debug prints
File:
1 edited

Legend:

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

    r9148 r9154  
    153153        void TowerDefense::addTower(int x, int y)
    154154        {
    155                 if (x > 15 || y > 15 || x < 0 || y < 0)//Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
     155                unsigned int width = this->center_->getWidth();
     156                unsigned int height = this->center_->getHeight();
     157                int tileScale = (int) this->center_->getTileScale();
     158               
     159                orxout() << "tile scale = " << tileScale << endl;
     160               
     161                if (x > 15 || y > 15 || x < 0 || y < 0)
    156162                {
     163                        //Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
    157164                        orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
    158165                        return;
    159166                }
    160167               
    161                 orxout()<< "Will add tower at (" << x << "," << y << ")" << endl;
     168                orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
    162169               
    163170                Tower* newTower = new Tower(this->center_);
     
    166173                this->center_->attach(newTower);
    167174               
    168                 newTower->setPosition(x-8,y-8,0);
     175                newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 0);
    169176                newTower->setGame(this);
    170177                //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;
Note: See TracChangeset for help on using the changeset viewer.