TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
tbx_rotate_behaviors.h
1 
9 #ifndef _TurtleBrains_RotateBehaviors_h_
10 #define _TurtleBrains_RotateBehaviors_h_
11 
12 #include "tbx_tweening_behavior.h"
13 #include "../../game/tb_entity_behavior_interface.h"
14 #include "../../game/tb_game_timer.h"
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 
95  class RotateTweenBehavior : public TweeningBehavior<float>
96  {
97  public:
100  RotateTweenBehavior(tbGame::Entity& entity, const float desiredOrientation, const tbGame::GameTimer& time, const TweenMode& tweenMode);
101 
102 
105  virtual ~RotateTweenBehavior(void);
106 
107 
111  virtual void OnResume(void) override;
112 
115  virtual void OnSimulate(void) override;
116 
117  private:
118  };
119 
120 
126  {
127  public:
137  RotateForBehavior(tbGame::Entity& entity, const float rotationSpeed, const tbGame::GameTimer& forTime);
138 
142  virtual ~RotateForBehavior(void);
143 
148  virtual void OnSimulate(void) override;
149 
150  private:
151  const float mRotationSpeed;
152  tbGame::GameTimer mTimeRemaining;
153  };
154 
155 
156  }; /* namespace Behaviors */
157 }; /* namespace TurtleBrainsExpress */
158 
160 
161 #endif /* _TurtleBrains_RotateBehaviors_h_ */
Definition: tb_entity.h:46
Definition: tbx_rotate_behaviors.h:58
Definition: tbx_rotate_behaviors.h:95
Definition: tb_entity_behavior_interface.h:25
Definition: tbx_rotate_behaviors.h:25
A collection of objects and functions to express games quickly.
Definition: tbx_tweening_behavior.h:21
RotateToBehavior(tbGame::Entity &entity, const float desiredOrientation, const float rotationSpeed)
Definition: tbx_rotate_behaviors.h:125
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.h:25