[10050] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[10111] | 23 | * Fabien Vultier |
---|
[10050] | 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | #ifndef _JumpFigure_H__ |
---|
| 30 | #define _JumpFigure_H__ |
---|
| 31 | |
---|
| 32 | #include "jump/JumpPrereqs.h" |
---|
| 33 | |
---|
| 34 | #include "worldentities/ControllableEntity.h" |
---|
| 35 | |
---|
| 36 | namespace orxonox |
---|
| 37 | { |
---|
| 38 | class _JumpExport JumpFigure : public ControllableEntity |
---|
| 39 | { |
---|
| 40 | public: |
---|
| 41 | JumpFigure(Context* context); //!< Constructor. Registers and initializes the object. |
---|
| 42 | virtual ~JumpFigure() {} |
---|
| 43 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
| 44 | virtual void tick(float dt); |
---|
| 45 | virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down. |
---|
| 46 | virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down. |
---|
| 47 | virtual void rotateYaw(const Vector2& value); |
---|
| 48 | virtual void rotatePitch(const Vector2& value); |
---|
| 49 | virtual void rotateRoll(const Vector2& value); |
---|
[10074] | 50 | void fire(unsigned int firemode); |
---|
[10050] | 51 | virtual void fired(unsigned int firemode); |
---|
| 52 | virtual void JumpFromPlatform(JumpPlatform* platform); |
---|
[10074] | 53 | virtual void JumpFromSpring(JumpSpring* spring); |
---|
| 54 | virtual void CollisionWithEnemy(JumpEnemy* enemy); |
---|
| 55 | virtual bool StartRocket(JumpRocket* rocket); |
---|
| 56 | virtual void StopRocket(JumpRocket* rocket); |
---|
| 57 | virtual bool StartPropeller(JumpPropeller* propeller); |
---|
| 58 | virtual void StopPropeller(JumpPropeller* propeller); |
---|
| 59 | virtual bool StartBoots(JumpBoots* boots); |
---|
| 60 | virtual void StopBoots(JumpBoots* boots); |
---|
| 61 | virtual bool StartShield(JumpShield* shield); |
---|
| 62 | virtual void StopShield(JumpShield* shield); |
---|
| 63 | virtual void InitializeAnimation(Context* context); |
---|
| 64 | |
---|
[10050] | 65 | void setFieldDimension(float width, float height) |
---|
[10074] | 66 | { fieldWidth_ = width; fieldHeight_ = height; } |
---|
[10050] | 67 | void setFieldDimension(const Vector2& dimension) |
---|
[10074] | 68 | { setFieldDimension(dimension.x, dimension.y); } |
---|
| 69 | Vector2 getFieldDimension() const |
---|
| 70 | { return Vector2(fieldWidth_, fieldHeight_); } |
---|
[10050] | 71 | void setMouseFactor(const float mouseFactor) |
---|
[10074] | 72 | { mouseFactor_ = mouseFactor; } |
---|
[10050] | 73 | const float getMouseFactor() const |
---|
[10074] | 74 | { return mouseFactor_; } |
---|
| 75 | void setModelLeftHand(const std::string& modelLeftHand) |
---|
| 76 | { modelLeftHand_ = modelLeftHand; } |
---|
| 77 | const std::string& getModelLeftHand() const |
---|
| 78 | { return modelLeftHand_; } |
---|
| 79 | void setModelRightHand(const std::string& modelRightHand) |
---|
| 80 | { modelRightHand_ = modelRightHand; } |
---|
| 81 | const std::string& getModelRightHand() const |
---|
| 82 | { return modelRightHand_; } |
---|
| 83 | void setRocketPos(const float rocketPos) |
---|
| 84 | { rocketPos_ = rocketPos; } |
---|
| 85 | const float getRocketPos() const |
---|
| 86 | { return rocketPos_; } |
---|
| 87 | void setPropellerPos(const float propellerPos) |
---|
| 88 | { propellerPos_ = propellerPos; } |
---|
| 89 | const float getPropellerPos() const |
---|
| 90 | { return propellerPos_; } |
---|
| 91 | void setBootsPos(const float bootsPos) |
---|
| 92 | { bootsPos_ = bootsPos; } |
---|
| 93 | const float getBootsPos() const |
---|
| 94 | { return bootsPos_; } |
---|
| 95 | void setJumpSpeed(const float jumpSpeed) |
---|
| 96 | { jumpSpeed_ = jumpSpeed; } |
---|
| 97 | const float getJumpSpeed() const |
---|
| 98 | { return jumpSpeed_; } |
---|
| 99 | void setRocketSpeed(const float rocketSpeed) |
---|
| 100 | { rocketSpeed_ = rocketSpeed; } |
---|
| 101 | const float getRocketSpeed() const |
---|
| 102 | { return rocketSpeed_; } |
---|
| 103 | void setPropellerSpeed(const float propellerSpeed) |
---|
| 104 | { propellerSpeed_ = propellerSpeed; } |
---|
| 105 | const float getPropellerSpeed() const |
---|
| 106 | { return propellerSpeed_; } |
---|
| 107 | void setHandMinAngle(const float handMinAngle) |
---|
| 108 | { handMinAngle_ = handMinAngle; } |
---|
| 109 | const float getHandMinAngle() const |
---|
| 110 | { return handMinAngle_; } |
---|
| 111 | void setHandMaxAngle(const float handMaxAngle) |
---|
| 112 | { handMaxAngle_ = handMaxAngle; } |
---|
| 113 | const float getHandMaxAngle() const |
---|
| 114 | { return handMaxAngle_; } |
---|
| 115 | void setHandSpeed(const float handSpeed) |
---|
| 116 | { handSpeed_ = handSpeed; } |
---|
| 117 | const float getHandSpeed() const |
---|
| 118 | { return handSpeed_; } |
---|
| 119 | |
---|
[10111] | 120 | bool fireSignal_; |
---|
| 121 | bool rocketActive_; |
---|
| 122 | bool propellerActive_; |
---|
[10074] | 123 | bool dead_; |
---|
[10050] | 124 | private: |
---|
[10074] | 125 | std::string modelLeftHand_; |
---|
| 126 | std::string modelRightHand_; |
---|
| 127 | Model* leftHand_; |
---|
| 128 | Model* rightHand_; |
---|
| 129 | float fieldWidth_; |
---|
[10050] | 130 | float fieldHeight_; |
---|
[10111] | 131 | float timeSinceLastFire_; |
---|
| 132 | bool moveUpPressed_; |
---|
| 133 | bool moveDownPressed_; |
---|
| 134 | bool moveLeftPressed_; |
---|
| 135 | bool moveRightPressed_; |
---|
| 136 | bool firePressed_; |
---|
| 137 | float gravityAcceleration_; |
---|
[10050] | 138 | float mouseFactor_; |
---|
[10074] | 139 | float jumpSpeed_; |
---|
| 140 | float handSpeed_; |
---|
| 141 | float handMaxAngle_; |
---|
| 142 | float handMinAngle_; |
---|
| 143 | float rocketPos_; |
---|
| 144 | float propellerPos_; |
---|
| 145 | float bootsPos_; |
---|
[10111] | 146 | float maxFireRate_; |
---|
| 147 | float horizontalSpeed_; |
---|
[10074] | 148 | float handAngle_; |
---|
| 149 | bool animateHands_; |
---|
| 150 | bool turnUp_; |
---|
| 151 | bool bootsActive_; |
---|
| 152 | bool shieldActive_; |
---|
| 153 | float rocketSpeed_; |
---|
| 154 | float propellerSpeed_; |
---|
[10050] | 155 | }; |
---|
| 156 | } |
---|
| 157 | |
---|
| 158 | #endif /* _JumpFigure_H__ */ |
---|