From 594131a372fa2d65dff0515f9b62843516a6c69f Mon Sep 17 00:00:00 2001 From: StephenAdamson Date: Fri, 17 Jan 2025 23:58:19 +0000 Subject: [PATCH] movement redo part 1 --- src/citizen.rs | 140 +++++++++++++++++++++++++++++++++---------------- src/main.rs | 2 +- 2 files changed, 96 insertions(+), 46 deletions(-) diff --git a/src/citizen.rs b/src/citizen.rs index 5276d8e..3e4f038 100644 --- a/src/citizen.rs +++ b/src/citizen.rs @@ -32,7 +32,10 @@ impl Citizen { use crate::constants::TILE_SIZE; use crate::tile::TileMap; use rand::{seq::SliceRandom, Rng}; -use std::collections::{BinaryHeap, HashMap, HashSet}; +use std::{ + collections::{BinaryHeap, HashMap, HashSet}, + process::exit, +}; #[derive(Component)] pub struct Ambulatory { @@ -105,6 +108,8 @@ pub fn update_citizen_targets( target_y as f32 * TILE_SIZE, z as f32 * TILE_SIZE, )); + println!("target: {:?}", ambulatory.target); + exit(0); ambulatory.current_path = None; ambulatory.path_index = 0; break; @@ -119,9 +124,24 @@ pub fn update_citizen_targets( pub fn citizen_movement( mut query: Query<(&mut Ambulatory, &mut Transform)>, tilemap: Res, - time: Res