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: |
---|
23 | * Fabien Vultier |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _JumpFigure_H__ |
---|
30 | #define _JumpFigure_H__ |
---|
31 | |
---|
32 | #include "jump/JumpPrereqs.h" |
---|
33 | #include "worldentities/ControllableEntity.h" |
---|
34 | |
---|
35 | namespace orxonox |
---|
36 | { |
---|
37 | class _JumpExport JumpFigure : public ControllableEntity |
---|
38 | { |
---|
39 | public: |
---|
40 | JumpFigure(Context* context); //!< Constructor. Registers and initializes the object. |
---|
41 | virtual ~JumpFigure() {} |
---|
42 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
43 | virtual void tick(float dt) override; |
---|
44 | virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down. |
---|
45 | virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down. |
---|
46 | virtual void rotateYaw(const Vector2& value) override; |
---|
47 | virtual void rotatePitch(const Vector2& value) override; |
---|
48 | virtual void rotateRoll(const Vector2& value) override; |
---|
49 | void fire(unsigned int firemode); |
---|
50 | virtual void fired(unsigned int firemode) override; |
---|
51 | virtual void JumpFromPlatform(JumpPlatform* platform); |
---|
52 | virtual void JumpFromSpring(JumpSpring* spring); |
---|
53 | virtual void CollisionWithEnemy(JumpEnemy* enemy); |
---|
54 | virtual bool StartRocket(JumpRocket* rocket); |
---|
55 | virtual void StopRocket(JumpRocket* rocket); |
---|
56 | virtual bool StartPropeller(JumpPropeller* propeller); |
---|
57 | virtual void StopPropeller(JumpPropeller* propeller); |
---|
58 | virtual bool StartBoots(JumpBoots* boots); |
---|
59 | virtual void StopBoots(JumpBoots* boots); |
---|
60 | virtual bool StartShield(JumpShield* shield); |
---|
61 | virtual void StopShield(JumpShield* shield); |
---|
62 | virtual void InitializeAnimation(Context* context); |
---|
63 | |
---|
64 | void setFieldDimension(float width, float height) |
---|
65 | { fieldWidth_ = width; fieldHeight_ = height; } |
---|
66 | void setFieldDimension(const Vector2& dimension) |
---|
67 | { setFieldDimension(dimension.x, dimension.y); } |
---|
68 | Vector2 getFieldDimension() const |
---|
69 | { return Vector2(fieldWidth_, fieldHeight_); } |
---|
70 | void setMouseFactor(const float mouseFactor) |
---|
71 | { mouseFactor_ = mouseFactor; } |
---|
72 | const float getMouseFactor() const |
---|
73 | { return mouseFactor_; } |
---|
74 | void setModelLeftHand(const std::string& modelLeftHand) |
---|
75 | { modelLeftHand_ = modelLeftHand; } |
---|
76 | const std::string& getModelLeftHand() const |
---|
77 | { return modelLeftHand_; } |
---|
78 | void setModelRightHand(const std::string& modelRightHand) |
---|
79 | { modelRightHand_ = modelRightHand; } |
---|
80 | const std::string& getModelRightHand() const |
---|
81 | { return modelRightHand_; } |
---|
82 | void setRocketPos(const float rocketPos) |
---|
83 | { rocketPos_ = rocketPos; } |
---|
84 | const float getRocketPos() const |
---|
85 | { return rocketPos_; } |
---|
86 | void setPropellerPos(const float propellerPos) |
---|
87 | { propellerPos_ = propellerPos; } |
---|
88 | const float getPropellerPos() const |
---|
89 | { return propellerPos_; } |
---|
90 | void setBootsPos(const float bootsPos) |
---|
91 | { bootsPos_ = bootsPos; } |
---|
92 | const float getBootsPos() const |
---|
93 | { return bootsPos_; } |
---|
94 | void setJumpSpeed(const float jumpSpeed) |
---|
95 | { jumpSpeed_ = jumpSpeed; } |
---|
96 | const float getJumpSpeed() const |
---|
97 | { return jumpSpeed_; } |
---|
98 | void setRocketSpeed(const float rocketSpeed) |
---|
99 | { rocketSpeed_ = rocketSpeed; } |
---|
100 | const float getRocketSpeed() const |
---|
101 | { return rocketSpeed_; } |
---|
102 | void setPropellerSpeed(const float propellerSpeed) |
---|
103 | { propellerSpeed_ = propellerSpeed; } |
---|
104 | const float getPropellerSpeed() const |
---|
105 | { return propellerSpeed_; } |
---|
106 | void setHandMinAngle(const float handMinAngle) |
---|
107 | { handMinAngle_ = handMinAngle; } |
---|
108 | const float getHandMinAngle() const |
---|
109 | { return handMinAngle_; } |
---|
110 | void setHandMaxAngle(const float handMaxAngle) |
---|
111 | { handMaxAngle_ = handMaxAngle; } |
---|
112 | const float getHandMaxAngle() const |
---|
113 | { return handMaxAngle_; } |
---|
114 | void setHandSpeed(const float handSpeed) |
---|
115 | { handSpeed_ = handSpeed; } |
---|
116 | const float getHandSpeed() const |
---|
117 | { return handSpeed_; } |
---|
118 | |
---|
119 | bool fireSignal_; |
---|
120 | bool dead_; |
---|
121 | |
---|
122 | JumpRocket* rocketActive_; |
---|
123 | JumpPropeller* propellerActive_; |
---|
124 | JumpBoots* bootsActive_; |
---|
125 | JumpShield* shieldActive_; |
---|
126 | private: |
---|
127 | std::string modelLeftHand_; |
---|
128 | std::string modelRightHand_; |
---|
129 | Model* leftHand_; |
---|
130 | Model* rightHand_; |
---|
131 | float fieldWidth_; |
---|
132 | float fieldHeight_; |
---|
133 | float timeSinceLastFire_; |
---|
134 | bool moveUpPressed_; |
---|
135 | bool moveDownPressed_; |
---|
136 | bool moveLeftPressed_; |
---|
137 | bool moveRightPressed_; |
---|
138 | bool firePressed_; |
---|
139 | float gravityAcceleration_; |
---|
140 | float mouseFactor_; |
---|
141 | float jumpSpeed_; |
---|
142 | float handSpeed_; |
---|
143 | float handMaxAngle_; |
---|
144 | float handMinAngle_; |
---|
145 | float rocketPos_; |
---|
146 | float propellerPos_; |
---|
147 | float bootsPos_; |
---|
148 | float maxFireRate_; |
---|
149 | float horizontalSpeed_; |
---|
150 | float handAngle_; |
---|
151 | bool animateHands_; |
---|
152 | bool turnUp_; |
---|
153 | float rocketSpeed_; |
---|
154 | float propellerSpeed_; |
---|
155 | }; |
---|
156 | } |
---|
157 | |
---|
158 | #endif /* _JumpFigure_H__ */ |
---|