Changeset 8563 for code/branches/tetris/src/modules/tetris/TetrisStone.cc
- Timestamp:
- May 24, 2011, 9:07:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tetris/src/modules/tetris/TetrisStone.cc
r8537 r8563 54 54 this->delay_ = false; 55 55 this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this))); 56 this->previousPosition_ = Vector3::ZERO;57 }58 59 void TetrisStone::tick(float dt)60 {61 SUPER(TetrisStone, tick, dt);62 56 } 63 57 … … 70 64 void TetrisStone::moveFrontBack(const Vector2& value) 71 65 { 72 66 if(value.x < 0) 67 { 68 this->setVelocity(this->getVelocity()*1.1); 69 } 73 70 } 74 71 … … 85 82 const Vector3& position = this->getPosition(); 86 83 Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z); 87 if(!this->tetris_->isValidMove(this, newPos) )84 if(!this->tetris_->isValidMove(this, newPos).first) 88 85 return; 89 86
Note: See TracChangeset
for help on using the changeset viewer.