Hey guys, just starting to learn blueprints and I searched all over and haven’t been able to find a solution to my issue (feeling myself stupid), hopefully you can help me.
So I’m doing a simple snake game with 4 action keys responsible for the snake’s directions, and the snake moves (through Add Actor World Offset) with each tick (I’ve set ticking to 0,25) - for example, when W is pressed, it would check through the branch whether the snake is moving in X axis and, if not, it would set snake to move up next tick, same with the other ones. However, I have faced an issue: the snake can move in opposite direction if I press 2 buttons simultaneously or in quick succession: for example, if, going up, I press the left button and then simultaneously the down button (all in-between ticks, it seems), at the next tick the snake will move down and not first left and only then down, thus the head will collide with its tail and the game will end.
So is there a way to put some input buffer or something else to prevent the head going in opposite direction and what is the best way to do so? Thanks in advance!