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
22
src/GameCommands/MoveLeftCommand.h
Normal file
22
src/GameCommands/MoveLeftCommand.h
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue