Changeset 11083 for code/trunk/src/modules/tetris
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/modules/tetris
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/tetris/Tetris.cc
r11071 r11083 140 140 const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone 141 141 142 if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())142 if((position.x == currentStonePosition.x) && std::abs(position.y-currentStonePosition.y) < this->center_->getStoneSize()) 143 143 return false; 144 144 } … … 222 222 if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level 223 223 { 224 float baseOffset = abs(stone->getPosition().y);224 float baseOffset = std::abs(stone->getPosition().y); 225 225 if (this->activeBrick_->getRotationCount() == 1 || this->activeBrick_->getRotationCount() == 3) 226 baseOffset = abs(stone->getPosition().x);226 baseOffset = std::abs(stone->getPosition().x); 227 227 float yOffset = baseOffset + this->center_->getStoneSize()/2.0f;//calculate offset 228 228 if(yOffset < 0) //catch brake-throughs -
code/trunk/src/modules/tetris/TetrisBrick.cc
r11071 r11083 213 213 { 214 214 const Vector3& position = this->getPosition(); 215 Vector3 newPos = Vector3(position.x+value.x/ abs(value.x)*this->size_, position.y, position.z);215 Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z); 216 216 if(!this->isValidMove(newPos)) 217 217 return; -
code/trunk/src/modules/tetris/TetrisStone.cc
r9667 r11083 92 92 { 93 93 const Vector3& position = this->getPosition(); 94 Vector3 newPos = Vector3(position.x+value.x/ abs(value.x)*this->size_, position.y, position.z);94 Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z); 95 95 if(!this->tetris_->isValidMove(this, newPos)) 96 96 return;
Note: See TracChangeset
for help on using the changeset viewer.