From 232377eae18dc02c6a6b606beda824421bc08156 Mon Sep 17 00:00:00 2001 From: nicknase27 Date: Wed, 30 Sep 2026 12:03:59 +0200 Subject: [PATCH] add restart keybind --- src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 45ef5bb..bce68d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,10 +233,14 @@ impl App { match self.state { Gamestate::Playing => { let canvas = Canvas::default() - .block(Block::bordered().title(format!( - " PongRS | {} - {} ", - self.player_score, self.enemy_score - )).title_alignment(Alignment::Center)) + .block( + Block::bordered() + .title(format!( + " PongRS | {} - {} ", + self.player_score, self.enemy_score + )) + .title_alignment(Alignment::Center), + ) .x_bounds([X_BOUNDS.0, X_BOUNDS.1]) .y_bounds([Y_BOUNDS.0, Y_BOUNDS.1]) .marker(Marker::Block) @@ -330,6 +334,7 @@ impl App { Gamestate::Won => self.restart(), Gamestate::Lost => self.restart(), }, + (_, KeyCode::Char('r')) => self.restart(), _ => {} } }