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