feat(player): added movements

This commit is contained in:
2024-01-08 14:13:16 +01:00
parent c7c7c91818
commit 0fed252afd
8 changed files with 113 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "Inputs.h"
void Inputs::HandleInputs(Event& event) {
if (event.type == Event::Closed)
{
_window.close();
return;
}
// Player movements
if (event.type == Event::KeyPressed) {
if (event.key.code == Keyboard::Left || event.key.code == Keyboard::Q) {
_player.Move(-1);
}
if (event.key.code == Keyboard::Right || event.key.code == Keyboard::D) {
_player.Move(1);
}
}
}