Last change
on this file since 9135 was
9135,
checked in by mentzerf, 13 years ago
|
+ Added class Tower, later will be used to spawn in towers
|
File size:
1.6 KB
|
Rev | Line | |
---|
[9135] | 1 | // |
---|
| 2 | // Tower.cc |
---|
| 3 | // Orxonox |
---|
| 4 | // |
---|
| 5 | // Created by Fabian Mentzer on 29.04.12. |
---|
| 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. |
---|
| 7 | // |
---|
| 8 | |
---|
| 9 | #include "Tower.h" |
---|
| 10 | |
---|
| 11 | #include "core/CoreIncludes.h" |
---|
| 12 | //#include "core/XMLPort.h" |
---|
| 13 | |
---|
| 14 | namespace orxonox |
---|
| 15 | { |
---|
| 16 | CreateFactory(Tower); |
---|
| 17 | |
---|
| 18 | /** |
---|
| 19 | @brief |
---|
| 20 | Constructor. Registers and initializes the object. |
---|
| 21 | */ |
---|
| 22 | Tower::Tower(BaseObject* creator) : ControllableEntity(creator) |
---|
| 23 | { |
---|
| 24 | RegisterObject(Tower); |
---|
| 25 | /* |
---|
| 26 | this->size_ = 10.0f; |
---|
| 27 | this->delay_ = false; |
---|
| 28 | this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this))); |
---|
| 29 | */ |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | @brief |
---|
| 34 | Overloaded the function to rotate the stone. |
---|
| 35 | @param value |
---|
| 36 | A vector whose first component is the angle by which to rotate. |
---|
| 37 | */ |
---|
| 38 | void Tower::moveFrontBack(const Vector2& value) |
---|
| 39 | { |
---|
| 40 | orxout() << "frontBack.x: " << value.x << endl; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | /** |
---|
| 44 | @brief |
---|
| 45 | Overloaded the function to steer the stone right and left |
---|
| 46 | @param value |
---|
| 47 | A vector whose first component is the direction in which we want to steer the stone. |
---|
| 48 | */ |
---|
| 49 | void Tower::moveRightLeft(const Vector2& value) |
---|
| 50 | { |
---|
| 51 | orxout() << "rightLeft.x: " << value.x << endl; |
---|
| 52 | /* |
---|
| 53 | if(!this->delay_) |
---|
| 54 | { |
---|
| 55 | const Vector3& position = this->getPosition(); |
---|
| 56 | Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z); |
---|
| 57 | if(!this->tetris_->isValidMove(this, newPos)) |
---|
| 58 | return; |
---|
| 59 | |
---|
| 60 | this->setPosition(newPos); |
---|
| 61 | this->delay_ = true; |
---|
| 62 | this->delayTimer_.startTimer(); |
---|
| 63 | } |
---|
| 64 | */ |
---|
| 65 | } |
---|
| 66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.