Changeset 9803 for code/trunk/src/modules
- Timestamp:
- Nov 21, 2013, 11:20:31 PM (11 years ago)
- Location:
- code/trunk/src/modules/tetris
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/tetris/Tetris.cc
r9802 r9803 124 124 this->startBrick(); 125 125 } 126 } 126 } 127 127 } 128 128 -
code/trunk/src/modules/tetris/TetrisBrick.cc
r9801 r9803 107 107 { 108 108 stone->setPosition(0.0f, 0.0f, 0.0f); 109 stone->setName("Base");110 109 } 111 110 else if(i == 1) 112 111 { 113 112 stone->setPosition(0.0f, size_, 0.0f); 114 stone->setName("Y");115 113 } 116 114 else if(i == 2) … … 119 117 { 120 118 stone->setPosition(0.0f, 2*size_, 0.0f); 121 stone->setName("2Y");122 119 } 123 120 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5) 124 121 { 125 122 stone->setPosition(size_, 0, 0.0f); 126 stone->setName("X");127 123 } 128 124 else if(this->shapeIndex_ == 2) 129 125 { 130 126 stone->setPosition(-size_, 0, 0.0f); 131 stone->setName("-X");132 127 } 133 128 } … … 137 132 { 138 133 stone->setPosition(size_, size_, 0.0f); 139 stone->setName("XY");140 134 } 141 135 else if(this->shapeIndex_ == 1) 142 136 { 143 137 stone->setPosition(0, 3*size_, 0.0f); 144 stone->setName("3Y");145 138 } 146 139 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7) 147 140 { 148 141 stone->setPosition(-size_, 0, 0.0f); 149 stone->setName("-X");150 142 } 151 143 else if(this->shapeIndex_ == 4) 152 144 { 153 145 stone->setPosition(-size_, size_, 0.0f); 154 stone->setName("-XY");155 146 } 156 147 else if(this->shapeIndex_ == 6) 157 148 { 158 149 stone->setPosition(size_, 0, 0.0f); 159 stone->setName("X");160 150 } 161 151 } … … 195 185 if(value.x < 0) //speedup on key down 196 186 { 197 this->setVelocity(this->getVelocity()*1.1); 187 Vector3 v_new = this->getVelocity()*1.2; 188 if (v_new.y < -400.0f) //limiting the speed to prevent break throughs. 189 v_new.y = -400.0f; 190 this->setVelocity(v_new); 198 191 } 199 192 else if(!this->lockRotation_) //rotate when key up is pressed
Note: See TracChangeset
for help on using the changeset viewer.