add restart keybind
CI/CD / clippy (push) Failing after 23s
CI/CD / test (push) Failing after 17s
CI/CD / Release (push) Skipped

This commit is contained in:
nicknase27 committed 2026-09-30 12:03:59 +02:00
1 parent 57a486f459
commit 232377eae1
1 file changed
+7 -2
+7 -2
View File
@@ -233,10 +233,14 @@ impl App {
match self.state { match self.state {
Gamestate::Playing => { Gamestate::Playing => {
let canvas = Canvas::default() let canvas = Canvas::default()
.block(Block::bordered().title(format!( .block(
Block::bordered()
.title(format!(
" PongRS | {} - {} ", " PongRS | {} - {} ",
self.player_score, self.enemy_score self.player_score, self.enemy_score
)).title_alignment(Alignment::Center)) ))
.title_alignment(Alignment::Center),
)
.x_bounds([X_BOUNDS.0, X_BOUNDS.1]) .x_bounds([X_BOUNDS.0, X_BOUNDS.1])
.y_bounds([Y_BOUNDS.0, Y_BOUNDS.1]) .y_bounds([Y_BOUNDS.0, Y_BOUNDS.1])
.marker(Marker::Block) .marker(Marker::Block)
@@ -330,6 +334,7 @@ impl App {
Gamestate::Won => self.restart(), Gamestate::Won => self.restart(),
Gamestate::Lost => self.restart(), Gamestate::Lost => self.restart(),
}, },
(_, KeyCode::Char('r')) => self.restart(),
_ => {} _ => {}
} }
} }