Changeset 9322 for code/branches/presentation2012merge
- Timestamp:
- Jul 21, 2012, 6:29:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/tetris/Tetris.cc
r9286 r9322 202 202 if((position.x == currentStonePosition.x) && (position.y < currentStonePosition.y + this->center_->getStoneSize())) 203 203 { 204 int y_offset = static_cast<int>((this->activeBrick_->getPosition().y-currentStonePosition.y+10)/10)*10 + currentStonePosition.y;204 float y_offset = static_cast<int>((this->activeBrick_->getPosition().y-currentStonePosition.y+10)/10)*10 + currentStonePosition.y; 205 205 if(y_offset < 0) //filter out extreme cases (very rare bug) 206 206 y_offset = 0; … … 213 213 if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level 214 214 { 215 int yOffset = stone->getPosition().y + this->center_->getStoneSize()/2.0f;//calculate offset215 float yOffset = stone->getPosition().y + this->center_->getStoneSize()/2.0f;//calculate offset 216 216 if(yOffset < 0) //catch brake-throughs 217 217 yOffset = 0; … … 246 246 Vector3 Tetris::rotateVector(Vector3 position, unsigned int amount) 247 247 { 248 int temp = 0;248 float temp = 0; 249 249 for(unsigned int i = 0; i < amount; i++) 250 250 { … … 383 383 // Attach the brick to the Centerpoint and set the position of the brick to be at the left side. 384 384 this->center_->attach(this->futureBrick_); 385 float xPos = (this->center_->getWidth()*1.6 + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();385 float xPos = (this->center_->getWidth()*1.6f + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize(); 386 386 float yPos = (this->center_->getHeight()-5.1f)*this->center_->getStoneSize(); 387 387 this->futureBrick_->setPosition(xPos, yPos, 0.0f);
Note: See TracChangeset
for help on using the changeset viewer.