Changeset 9801
- Timestamp:
- Nov 21, 2013, 9:26:33 PM (11 years ago)
- Location:
- code/trunk/src/modules/tetris
- Files:
-
- 3 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); -
code/trunk/src/modules/tetris/TetrisBrick.cc
r9756 r9801 107 107 { 108 108 stone->setPosition(0.0f, 0.0f, 0.0f); 109 stone->setName("Base"); 109 110 } 110 111 else if(i == 1) 111 112 { 112 113 stone->setPosition(0.0f, size_, 0.0f); 114 stone->setName("Y"); 113 115 } 114 116 else if(i == 2) … … 117 119 { 118 120 stone->setPosition(0.0f, 2*size_, 0.0f); 121 stone->setName("2Y"); 119 122 } 120 123 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5) 121 124 { 122 125 stone->setPosition(size_, 0, 0.0f); 126 stone->setName("X"); 123 127 } 124 128 else if(this->shapeIndex_ == 2) 125 129 { 126 130 stone->setPosition(-size_, 0, 0.0f); 131 stone->setName("-X"); 127 132 } 128 133 } … … 132 137 { 133 138 stone->setPosition(size_, size_, 0.0f); 139 stone->setName("XY"); 134 140 } 135 141 else if(this->shapeIndex_ == 1) 136 142 { 137 143 stone->setPosition(0, 3*size_, 0.0f); 144 stone->setName("3Y"); 138 145 } 139 146 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7) 140 147 { 141 148 stone->setPosition(-size_, 0, 0.0f); 149 stone->setName("-X"); 142 150 } 143 151 else if(this->shapeIndex_ == 4) 144 152 { 145 153 stone->setPosition(-size_, size_, 0.0f); 154 stone->setName("-XY"); 146 155 } 147 156 else if(this->shapeIndex_ == 6) 148 157 { 149 158 stone->setPosition(size_, 0, 0.0f); 159 stone->setName("X"); 150 160 } 151 161 } -
code/trunk/src/modules/tetris/TetrisScore.h
r9667 r9801 21 21 * 22 22 * Author: 23 * Fabian 'x3n' Landau23 * Johannes Ritz 24 24 * Co-authors: 25 25 * ...
Note: See TracChangeset
for help on using the changeset viewer.