Started project, implemented keyboard and controller movement

This commit is contained in:
Sarah Faey 2025-04-17 22:53:25 +02:00
parent b1f5d882f0
commit d8fa53801b
33 changed files with 931 additions and 73 deletions

View file

@ -0,0 +1,22 @@
#ifndef MOVE_LEFT_COMMAND_H
#define MOVE_LEFT_COMMAND_H
#include "GameCommand.h"
#include <iostream>
#include <memory>
#include <SDL3/SDL.h>
#include "../Components/MoveComponent.h"
class MoveLeftCommand : public GameCommand
{
public:
MoveLeftCommand(SDL_FPoint & directionInput, bool & buttonInput) : m_directionInput(&directionInput), m_buttonInput(&buttonInput) {};
~MoveLeftCommand() {};
void Down() override { m_directionInput->x -= 1; *m_buttonInput = true;}
void Up() override { m_directionInput->x += 1; *m_buttonInput = true;}
private:
SDL_FPoint * m_directionInput;
bool * m_buttonInput;
};
#endif