diff --git a/tngame-rs/src/main.rs b/tngame-rs/src/main.rs index 97ea8a5..d7d6201 100644 --- a/tngame-rs/src/main.rs +++ b/tngame-rs/src/main.rs @@ -109,6 +109,7 @@ struct Consts { asc_tree: AsciiArt, asc_house: AsciiArt, asc_title: AsciiArt, + asc_soon: AsciiArt, } struct Mutes { @@ -174,11 +175,20 @@ impl Consts { __._ _ . , . . , _ ._.| _| _) [ )(_) \/\/ \_| \/\/ (_)[ |(_] ._| "#, "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 { asc_cat, asc_tree, asc_house, asc_title, + asc_soon, } } } @@ -360,9 +370,13 @@ impl Mutes { } // 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) { + let wf = mt.w as f32; + let xf = mt.x as f32; + // Draw the tree let tree_1_start = (mt.w - 2 * cn.asc_tree.w) / 4; 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); 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); } @@ -380,6 +394,7 @@ fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) { // 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_soon, (1.7 * wf) as i32, (mt.h - cn.asc_soon.h) / 2, COLOR_CAT); // Draw the 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 { 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>, cn: &Consts) -> Result<()> { { let mut mt = mt.lock().await; 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 { mt.state = State::Exploring; }