Changeset 9801 for code/trunk/src/modules/tetris/Tetris.cc
- Timestamp:
- Nov 21, 2013, 9:26:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/tetris/Tetris.cc
r9795 r9801 50 50 #include "TetrisBrick.h" 51 51 #include "infos/PlayerInfo.h" 52 #include <cmath> 52 53 53 54 namespace orxonox … … 210 211 if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level 211 212 { 212 float yOffset = stone->getPosition().y + this->center_->getStoneSize()/2.0f;//calculate offset 213 float baseOffset = abs(stone->getPosition().y); 214 if (this->activeBrick_->getRotationCount() == 1 || this->activeBrick_->getRotationCount() == 3) 215 baseOffset = abs(stone->getPosition().x); 216 float yOffset = baseOffset + this->center_->getStoneSize()/2.0f;//calculate offset 213 217 if(yOffset < 0) //catch brake-throughs 214 218 yOffset = 0; … … 388 392 float xPos = (this->center_->getWidth()*1.6f + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize(); 389 393 float yPos = (this->center_->getHeight()-5.1f)*this->center_->getStoneSize(); 394 390 395 this->futureBrick_->setPosition(xPos, yPos, 0.0f); 391 396 this->futureBrick_->setGame(this);
Note: See TracChangeset
for help on using the changeset viewer.