3 Commits
Author SHA1 Message Date
nicknase27 7fc808b262 fix workflow file
CI/CD / clippy (push) Successful in 22s
CI/CD / test (push) Successful in 22s
CI/CD / Release (push) Successful in 44s
2026-09-30 12:08:48 +02:00
nicknase27 232377eae1 add restart keybind
CI/CD / clippy (push) Failing after 23s
CI/CD / test (push) Failing after 17s
CI/CD / Release (push) Skipped
2026-09-30 12:03:59 +02:00
nicknase27 57a486f459 Fix title position 2026-09-30 12:01:01 +02:00
2 changed files with 9 additions and 4 deletions

No files matched your search

-1
View File
@@ -7,7 +7,6 @@ on:
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: clippy
+9 -3
View File
@@ -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 | {} - {}",
.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(),
_ => {}
}
}