Skip to content

Commit

Permalink
added proper colors and resynced
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueRuby committed Nov 1, 2022
1 parent b074532 commit 0fc2fc8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ edition = "2021"

[dependencies]
rodio = "0.16.0"
colored = "2.0.0"
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{fs, io::BufReader, thread, time::Duration};

use rodio::{source::Source, Decoder, OutputStream};
use colored::*;

fn main() {
print!("\x1B[2J\x1B[1;1H");
Expand All @@ -22,13 +23,13 @@ fn main() {
.unwrap();

while frame_num <= 2180 {
print!("\x1b[1;1H"); //equiv to cls or clear
print!("{}", frames[frame_num]);
print!("{}", "\x1b[1;1H".white().on_black()); //equiv to cls or clear
print!("{}", frames[frame_num].black().on_white());

frame_num += 1;

thread::sleep(Duration::from_secs_f32(1.0 / 10.625));
thread::sleep(Duration::from_secs_f32(1.0 / 10.67125)); // I spent literal hours figuring the exact value out compensating for lag
}

print!("\x1B[2J\x1B[1;1H");
print!("{}", "\x1B[2J\x1B[1;1H".white().on_black());
}

0 comments on commit 0fc2fc8

Please sign in to comment.