Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2019, 3:32:40 PM (6 years ago)
Author:
pomselj
Message:

bounces moore smoothly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12359 r12360  
    242242            this->stones_.push_back(this->futureWall_->getStone(i));
    243243        }
     244
     245        for(OrxoBloxWall* wall : this->activeWalls_) {
     246            if(wall->isEmpty()) {
     247                wall->destroy();
     248            }
     249            int NumberOfStones = 0;
     250            for(int i = 0; i < 10; i++) {
     251                if(wall->getStone(i) == nullptr) {
     252                    continue;
     253                }
     254                else {
     255                    NumberOfStones++;
     256                }
     257
     258            }
     259        }
    244260        //new location of ship
    245261        //new amount of balls
     
    283299            orxout() << "Checking a stone" << endl;
    284300            const Vector3& StonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    285             int size = someStone->getSize();
    286             if((BallPosition.x >= StonePosition.x - size && BallPosition.x <= StonePosition.x + size) &&
    287                 (BallPosition.z >= StonePosition.z - size && BallPosition.z <= StonePosition.z + size)) {
     301            int size = someStone->getSize()/2;
     302            if((BallPosition.x - Ball->getRadius() >= StonePosition.x - size && BallPosition.x + Ball->getRadius() <= StonePosition.x + size) &&
     303                (BallPosition.z - Ball->getRadius() >= StonePosition.z - size && BallPosition.z + Ball->getRadius() <= StonePosition.z + size)) {
    288304                orxout() << "FOUND ONE" << endl;
    289305                return someStone;
Note: See TracChangeset for help on using the changeset viewer.