|
|
|
|
|
by fb03
3278 days ago
|
|
Not the author, but I've implemented my own snake game and this bug is fairly easy to kill. (1) - You can only change directions that will change your axis, if you're going left your possible changes are up and down, .... (2) - You should be only able to consume one direction change per game tick, what is happening here is that rule (1) is working but you can change into the other axis, and then back to the other axis again before the game loop computes another frame. Direction change can be read asynchronously but the actual change should be tied by each tick. |
|