From 21c7fe5c06a3eb2373a4b37159dacf65198b6f74 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 9 Mar 2023 01:37:46 -0500 Subject: [PATCH] [+] More trees --- tngame-rs/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tngame-rs/src/main.rs b/tngame-rs/src/main.rs index fd6695f..3cb6adb 100644 --- a/tngame-rs/src/main.rs +++ b/tngame-rs/src/main.rs @@ -359,6 +359,9 @@ 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]; + fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) { // Draw the tree let tree_1_start = (mt.w - 2 * cn.asc_tree.w) / 4; @@ -366,6 +369,11 @@ fn draw_ascii_frame(mt: &mut Mutes, cn: &Consts) { mt.print_ascii(&cn.asc_tree, tree_1_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() { + let x = (mt.w as f32 * x).round() as i32; + mt.print_ascii(&cn.asc_tree, x, mt.h - cn.asc_tree.h, COLOR_TREE); + } + // Draw the house let house_start = (mt.w + cn.asc_house.w) / 2; mt.print_ascii(&cn.asc_house, house_start, mt.h - cn.asc_house.h, COLOR_HOUSE);