Changeset 9945 for code/trunk/src/modules/tetris
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (11 years ago)
- Location:
- code/trunk/src/modules/tetris
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/tetris/TetrisBrick.cc
r9803 r9945 87 87 stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate()); 88 88 else 89 89 orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl; 90 90 } 91 91 else … … 116 116 if(this->shapeIndex_ == 1 || this->shapeIndex_ == 6 || this->shapeIndex_ == 7) 117 117 { 118 118 stone->setPosition(0.0f, 2*size_, 0.0f); 119 119 } 120 120 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5) 121 121 { 122 122 stone->setPosition(size_, 0, 0.0f); 123 123 } 124 124 else if(this->shapeIndex_ == 2) 125 125 { 126 126 stone->setPosition(-size_, 0, 0.0f); 127 127 } 128 128 } … … 131 131 if(this->shapeIndex_ == 2 || this->shapeIndex_ == 5) 132 132 { 133 133 stone->setPosition(size_, size_, 0.0f); 134 134 } 135 135 else if(this->shapeIndex_ == 1) 136 136 { 137 137 stone->setPosition(0, 3*size_, 0.0f); 138 138 } 139 139 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7) 140 140 { 141 141 stone->setPosition(-size_, 0, 0.0f); 142 142 } 143 143 else if(this->shapeIndex_ == 4) 144 144 { 145 145 stone->setPosition(-size_, size_, 0.0f); 146 146 } 147 147 else if(this->shapeIndex_ == 6) 148 148 { 149 149 stone->setPosition(size_, 0, 0.0f); 150 150 } 151 151 } … … 154 154 bool TetrisBrick::isValidMove(const Vector3& position, bool isRotation = false) 155 155 { 156 156 return this->tetris_->isValidMove(this,position, isRotation); 157 157 } 158 158 159 159 TetrisStone* TetrisBrick::getStone(unsigned int i) 160 160 { 161 161 if(i < this->brickStones_.size()) 162 162 return this->brickStones_[i]; 163 163 else return NULL; 164 164 } 165 165 … … 192 192 else if(!this->lockRotation_) //rotate when key up is pressed 193 193 { 194 195 194 if(!isValidMove(this->getPosition(), true)) //catch illegal rotations 195 return; 196 196 this->lockRotation_ = true; // multiple calls of this function have to be filtered out. 197 197 this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisBrick::unlockRotation, this))); -
code/trunk/src/modules/tetris/TetrisScore.cc
r9667 r9945 92 92 { 93 93 std::string score("0"); 94 94 if(!this->owner_->hasEnded()) 95 95 { 96 96 //get the player
Note: See TracChangeset
for help on using the changeset viewer.