Changeset 8537 for code/branches/tetris/src/modules/tetris/TetrisStone.cc
- Timestamp:
- May 23, 2011, 3:06:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tetris/src/modules/tetris/TetrisStone.cc
r8249 r8537 37 37 #include "core/XMLPort.h" 38 38 39 #include "Tetris.h" 40 39 41 namespace orxonox 40 42 { … … 52 54 this->delay_ = false; 53 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); 54 62 } 55 63 … … 76 84 { 77 85 const Vector3& position = this->getPosition(); 78 this->setPosition(position.x+value.x/abs(value.x)*this->size_, position.y, position.z); 86 Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z); 87 if(!this->tetris_->isValidMove(this, newPos)) 88 return; 89 90 //this->previousPosition_ = position; 91 this->setPosition(newPos); 79 92 this->delay_ = true; 80 93 this->delayTimer_.startTimer();
Note: See TracChangeset
for help on using the changeset viewer.