Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fc808b262
|
||
|
|
232377eae1
|
||
|
|
57a486f459
|
No files matched your search
@@ -7,7 +7,6 @@ on:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
name: clippy
|
||||
|
||||
+10
-4
@@ -1,5 +1,6 @@
|
||||
use crossterm::event::{Event, EventStream, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use ratatui::layout::Alignment;
|
||||
use ratatui::layout::Constraint::Percentage;
|
||||
use ratatui::layout::HorizontalAlignment::Center;
|
||||
use ratatui::style::Stylize;
|
||||
@@ -232,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
|
||||
)))
|
||||
.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)
|
||||
@@ -329,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