Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 13, 2012, 5:44:29 PM (12 years ago)
Author:
jo
Message:

backup checkin - still the same bugs experiencable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pCuts/src/modules/tetris/Tetris.cc

    r9084 r9085  
    9999            {
    100100                this->activeBrick_->setVelocity(Vector3::ZERO);
     101                this->activeBrick_->releaseStones(this->center_);
     102                //delete this->activeBrick_; //releasing the memory
    101103                this->createBrick();
    102104                this->startBrick();
     
    120122
    121123            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     124            orxout()<< "position.x: " << position.x << endl;
     125            orxout()<< "currentStonePosition.x: " << currentStonePosition.x << endl;
     126            if(position.x == currentStonePosition.x)
     127                orxout()<< "NON Valid Move Candidate" <<endl;
    122128
    123129            if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     
    145151                stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount());
    146152
    147             /*orxout()<< "stoneRelativePoistion: " << stonePosition << endl;
    148             orxout()<< "stoneTotalPoistion   : " << position + stonePosition << endl;*/
    149 
    150153            if(! this->isValidMove(stone, position + stonePosition )) // wrong position??
    151154            {
     
    168171            if(this->activeBrick_->contains(*it))
    169172                continue;
    170 //TODO: is this rotation correct ??
    171             Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
     173            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
     174            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
    172175            //!< Saves the position of the currentStone
     176            if(position.x == currentStonePosition.x)
     177            {
     178                orxout()<< "candidate found" << endl;
     179                orxout()<< "position.y: "<< position.y << endl;
     180                orxout()<< "urrentStonePosition.y: " << currentStonePosition.y << endl;
     181            }
    173182
    174183            if((position.x == currentStonePosition.x) && (position.y < currentStonePosition.y + this->center_->getStoneSize()))
    175184            {//TODO: Why are such events not detected ??
     185             // Because currentStonePosition.x isn't calculated globally, but locally
    176186                orxout()<< "YEAY !!"<<endl;
    177187                this->activeBrick_->setPosition(Vector3(this->activeBrick_->getPosition().x, currentStonePosition.y+this->center_->getStoneSize(), this->activeBrick_->getPosition().z));
     
    207217    /**
    208218    @brief
    209         Nasty function that allocates memory!! it rolls a vector 90° * amount
     219        A Vector3 is rolled 90 * degrees * amount (anticlockwise rotation)
    210220    */
    211221    Vector3 Tetris::rotateVector(Vector3 position, unsigned int amount)
    212222    {
    213 
    214223        int temp = 0;
    215224        for(unsigned int i = 0; i < amount; i++)
     
    230239        if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.
    231240        {
    232             // Create the first stone.
     241            // Create the first brick.
    233242            this->createBrick();
    234243        }
Note: See TracChangeset for help on using the changeset viewer.