[+] Coming soon text

This commit is contained in:
Azalea Gui
2023-03-09 02:06:48 -05:00
parent 13a5cbf2bc
commit ba95f80b70
+26 -3
View File
@@ -109,6 +109,7 @@ struct Consts {
asc_tree: AsciiArt, asc_tree: AsciiArt,
asc_house: AsciiArt, asc_house: AsciiArt,
asc_title: AsciiArt, asc_title: AsciiArt,
asc_soon: AsciiArt,
} }
struct Mutes { struct Mutes {
@@ -174,11 +175,20 @@ impl Consts {
__._ _ . , . . , _ ._.| _| __._ _ . , . . , _ ._.| _|
_) [ )(_) \/\/ \_| \/\/ (_)[ |(_] _) [ )(_) \/\/ \_| \/\/ (_)[ |(_]
._| "#, "Generated by patorjk.com/software/taag with font Contessa"); ._| "#, "Generated by patorjk.com/software/taag with font Contessa");
let asc_soon = AsciiArt::new(
r#"
_. _ ._ _ *._ _ __ _ _ ._ ._ ._ ._ (TM)
(_.(_)[ | )|[ )(_] _) (_)(_)[ )[ )[ )[ ) * * * * *
._|
Still paving the paths for the journey ahead...
(btw, isn't 3d-ish holographic text like suuuper cool??!)"#, "Generated by patorjk.com/software/taag with font Contessa");
Self { Self {
asc_cat, asc_cat,
asc_tree, asc_tree,
asc_house, asc_house,
asc_title, asc_title,
asc_soon,
} }
} }
} }
@@ -360,9 +370,13 @@ impl Mutes {
} }
// Tree x positions as percentages of the screen width // Tree x positions as percentages of the screen width
const TREE_X_POSITIONS: [f32; 5] = [2.4, 3.2, 4.0, 4.5, 5.2]; const TREE_X_POSITIONS: [f32; 7] = [1.5, 2.2, 2.8, 3.2, 4.0, 4.5, 5.2];
const X_BOUND_VW: f32 = 2.3;
fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) { fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) {
let wf = mt.w as f32;
let xf = mt.x as f32;
// Draw the tree // Draw the tree
let tree_1_start = (mt.w - 2 * cn.asc_tree.w) / 4; let tree_1_start = (mt.w - 2 * cn.asc_tree.w) / 4;
let tree_2_start = (mt.w + 2 * cn.asc_tree.w) / 2; let tree_2_start = (mt.w + 2 * cn.asc_tree.w) / 2;
@@ -370,7 +384,7 @@ fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) {
mt.print_ascii(&cn.asc_tree, tree_2_start, mt.h - cn.asc_tree.h, COLOR_TREE); mt.print_ascii(&cn.asc_tree, tree_2_start, mt.h - cn.asc_tree.h, COLOR_TREE);
for x in TREE_X_POSITIONS.iter() { for x in TREE_X_POSITIONS.iter() {
let x = (mt.w as f32 * x).round() as i32; let x = (wf * x).round() as i32;
mt.print_ascii(&cn.asc_tree, x, mt.h - cn.asc_tree.h, COLOR_TREE); mt.print_ascii(&cn.asc_tree, x, mt.h - cn.asc_tree.h, COLOR_TREE);
} }
@@ -380,6 +394,7 @@ fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) {
// Draw title at the center of the screen // Draw title at the center of the screen
mt.print_ascii(&cn.asc_title, (mt.w - cn.asc_title.w) / 2, (mt.h - cn.asc_title.h) / 2, COLOR_CAT); mt.print_ascii(&cn.asc_title, (mt.w - cn.asc_title.w) / 2, (mt.h - cn.asc_title.h) / 2, COLOR_CAT);
mt.print_ascii(&cn.asc_soon, (1.7 * wf) as i32, (mt.h - cn.asc_soon.h) / 2, COLOR_CAT);
// Draw the cat // Draw the cat
mt.print_ascii(&cn.asc_cat, mt.x, mt.h - cn.asc_cat.h, COLOR_CAT); mt.print_ascii(&cn.asc_cat, mt.x, mt.h - cn.asc_cat.h, COLOR_CAT);
@@ -406,6 +421,14 @@ fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) {
else if mt.x == 0 { else if mt.x == 0 {
chat("The cliff looks steep.\nBut I can't fly...", mt); chat("The cliff looks steep.\nBut I can't fly...", mt);
} }
// Cat is in the middle of nowhere
if (1.5 * wf..1.8 * wf).contains(&xf) {
chat("What is this?", mt);
}
// if (wf * X_BOUND_VW - 3.0..wf * X_BOUND_VW + 3.0).contains(&xf) {
// chat("", mt);
// }
} }
} }
@@ -467,7 +490,7 @@ async fn pull_input(mt: Arc<Mutex<Mutes>>, cn: &Consts) -> Result<()> {
{ {
let mut mt = mt.lock().await; let mut mt = mt.lock().await;
let mut move_x = |amount: i32| { let mut move_x = |amount: i32| {
mt.x = (mt.x + amount).max(0); mt.x = (mt.x + amount).max(0).min((mt.w as f32 * X_BOUND_VW) as i32);
if mt.state == State::Welcome { if mt.state == State::Welcome {
mt.state = State::Exploring; mt.state = State::Exploring;
} }