From 73520dcfd4839170c69644f031573608af340911 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 12 Jan 2025 09:45:53 +0900 Subject: blink fish --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 606326e..8606420 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ struct Turbofish { x: i16, y: u16, speed: i16, - bold: bool, + blink: bool, } impl Turbofish { @@ -34,7 +34,7 @@ impl Turbofish { fn tick(&mut self) { self.x += self.speed; - self.bold = !self.bold; + self.blink = !self.blink; } } @@ -55,8 +55,8 @@ fn render(mut stdout: impl Write, school_of_fish: &Vec, columns: u16) for fish in school_of_fish { let x = fish.x; let y = fish.y; - if fish.bold { - write!(stdout, "{}", termion::style::Bold).unwrap(); + if fish.blink { + write!(stdout, "{}", termion::color::Fg(termion::color::LightBlack)).unwrap(); } write!( stdout, @@ -91,7 +91,7 @@ fn main() { x, y, speed, - bold: rng.gen(), + blink: rng.gen(), }); } -- cgit v1.2.3-70-g09d2