add restart keybind
This commit is contained in:
1 file changed
+9
-4
+9
-4
@@ -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(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user