Hello guys
I played a bit around with the SFML and encounter a problem, for which I havent a solution.
I work on a little game with a spaceship, which fly around.
I have a main game loop with event,move objects, clear screen, draw objects and display.
However, I stuck on the event to move part
my function is like this
switch (Event.Type)
some events
.
.
case Window.KeyPressed:
InputManager (Window.GetInput () )
And InputManager looks like this
void InputManager (sf::Key::Code Input)
switch (Input)
case sf::Key::Code::Left
Move (left)
.
.
some other key case
Ive thought about seperate the functions, but I dont like the idea.
For me, an input is an event.
Of course there is the function IsKeyPressed, but it only returns true or false and not the pressed key.
Also sf::Input cant be put into a switch statement, as like IsKeyPressed.
I dont have a solution, maybe anyone have a better Idea?