Movement with left/right arrow keys.

Movement is hardcoded but it works.
Also fixed some typos that gave me a hard time figuring out why
movement was giving all sort of crazy problems. Very bad typos,
see gameplaysceneclassic.cpp, inputbag.cpp, inputbag.hpp and key.hpp
if you want to get goosebumps.
This commit is contained in:
King_DuckZ 2014-02-25 00:36:33 +01:00
parent 597607366e
commit ab31e94bf0
10 changed files with 116 additions and 6 deletions

30
src/moverleftright.hpp Normal file
View file

@ -0,0 +1,30 @@
#ifndef id340A16673C014E0BBFE8AC24D8FC1C77
#define id340A16673C014E0BBFE8AC24D8FC1C77
#include "moveroneshot.hpp"
namespace cloonel {
class MoverLeftRight : public MoverOneShot {
public:
enum MovementDirectionType {
MovementDirection_Left,
MovementDirection_Right,
MovementDirection_Still
};
MoverLeftRight ( void );
virtual ~MoverLeftRight ( void ) noexcept = default;
void SetMovement ( MovementDirectionType parDirection );
private:
virtual float2 GetOffset ( void ) const;
virtual void ApplyMotion ( float parDelta );
float m_movement;
float m_velocity;
float m_step;
};
} //namespace cloonel
#endif