TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tbx_rotate_behaviors.hpp
1 
9 #ifndef TurtleBrains_RotateBehaviors_hpp
10 #define TurtleBrains_RotateBehaviors_hpp
11 
12 #include <turtle_brains/express/behaviors/tbx_tweening_behavior.hpp>
13 #include <turtle_brains/game/tb_entity_behavior_interface.hpp>
14 #include <turtle_brains/game/tb_game_timer.hpp>
15 
16 namespace TurtleBrainsExpress
17 {
18  namespace Behaviors
19  {
26  {
27  public:
37  RotateBehavior(tbGame::Entity& entity, const float rotationSpeed);
38 
42  virtual ~RotateBehavior(void);
43 
47  virtual void OnSimulate(void) override;
48 
49  private:
50  const float mRotationSpeed;
51  };
52 
53 
59  {
60  public:
74  RotateToBehavior(tbGame::Entity& entity, const float desiredOrientation, const float rotationSpeed);// ,
75  //bool shortestDirection = false, bool normalizedOrientation = false);
76 
80  virtual ~RotateToBehavior(void);
81 
85  virtual void OnSimulate(void) override;
86 
87  private:
88  const float mDesiredOrientation;
89  const float mRotationSpeed;
90  };
91 
92 
97  class RotateTweenBehavior : public TweeningBehavior<float>
98  {
99  public:
110  RotateTweenBehavior(tbGame::Entity& entity, const float desiredOrientation, const tbGame::GameTimer& time, const TweenMode& tweenMode);
111 
115  virtual ~RotateTweenBehavior(void);
116 
121  virtual void OnRemove(void) override;
122 
128  virtual void OnResume(void) override;
129 
134  virtual void OnSimulate(void) override;
135  };
136 
137 
143  {
144  public:
154  RotateForBehavior(tbGame::Entity& entity, const float rotationSpeed, const tbGame::GameTimer& forTime);
155 
159  virtual ~RotateForBehavior(void);
160 
165  virtual void OnSimulate(void) override;
166 
167  private:
168  const float mRotationSpeed;
169  tbGame::GameTimer mTimeRemaining;
170  };
171 
172 
173  }; /* namespace Behaviors */
174 }; /* namespace TurtleBrainsExpress */
175 
177 
178 #endif /* TurtleBrains_RotateBehaviors_hpp */
Definition: tb_entity.hpp:46
Definition: tbx_rotate_behaviors.hpp:58
Definition: tbx_rotate_behaviors.hpp:97
Definition: tb_entity_behavior_interface.hpp:24
Definition: tbx_rotate_behaviors.hpp:25
A collection of objects and functions to express games quickly.
Definition: tbx_tweening_behavior.hpp:26
RotateToBehavior(tbGame::Entity &entity, const float desiredOrientation, const float rotationSpeed)
Definition: tbx_rotate_behaviors.hpp:142
RotateForBehavior(tbGame::Entity &entity, const float rotationSpeed, const tbGame::GameTimer &forTime)
Contains high-level objects to control the entities in game worlds.
RotateBehavior(tbGame::Entity &entity, const float rotationSpeed)
Definition: tb_game_timer.hpp:25
RotateTweenBehavior(tbGame::Entity &entity, const float desiredOrientation, const tbGame::GameTimer &time, const TweenMode &tweenMode)