Started project, implemented keyboard and controller movement
This commit is contained in:
parent
b1f5d882f0
commit
d8fa53801b
33 changed files with 931 additions and 73 deletions
26
src/Components/MoveComponent.h
Normal file
26
src/Components/MoveComponent.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef MOVE_COMPONENT_H
|
||||
#define MOVE_COMPONENT_H
|
||||
|
||||
#include <memory>
|
||||
#include<math.h>
|
||||
#include <SDL3/SDL_rect.h>
|
||||
#include "../Actors/Actor.h"
|
||||
#include "../DataStructures/NormalizedDirection.h"
|
||||
|
||||
class MoveComponent
|
||||
{
|
||||
public:
|
||||
MoveComponent(std::weak_ptr<Actor> actor): m_Actor(actor), m_Speed(10) {}; //TODO: speed
|
||||
void Update(float deltaTime);
|
||||
void SetDirection(const NormalizedDirection & direction);
|
||||
void SetSpeed(float speed);
|
||||
void SetForced(const NormalizedDirection & direction, float speed, float distance);
|
||||
|
||||
private:
|
||||
std::weak_ptr<Actor> m_Actor;
|
||||
NormalizedDirection m_Direction;
|
||||
float m_Speed;
|
||||
float m_ForcedDistance;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue