Closed timschwarzbrunn closed 2 years ago
The game crushes if you press e.g. the key "k". Change in game.rs the key detection from
let dir = match key { Key::Up => Some(Direction::Up), Key::Down => Some(Direction::Down), Key::Left => Some(Direction::Left), Key::Right => Some(Direction::Right), _ => None };
to
let dir = match key { Key::Up => Some(Direction::Up), Key::Down => Some(Direction::Down), Key::Left => Some(Direction::Left), Key::Right => Some(Direction::Right), _ => return };
Nice game!
Sorry for my late response. Thanks for your quick fix! I have fixed the problem accordingly (https://github.com/SLMT/rust-snake/commit/91db082d0e2f767f160392c09bd64f4d44e84412).
The game crushes if you press e.g. the key "k". Change in game.rs the key detection from
to
Nice game!