Gaussian idle

This commit is contained in:
2026-03-22 11:29:50 +00:00
parent b2dc0cb864
commit 2f456f80b8
14 changed files with 354 additions and 106 deletions
+7 -3
View File
@@ -1,9 +1,10 @@
use crate::config::GameConfig;
use crate::constants::TILE_SIZE;
use crate::constants::*;
use crate::entities::behaviour::{EntityBehaviourRegistry, EntityType};
use crate::entities::cargo::{CarryVisualState, HaulSlot};
use crate::entities::shared_components::Ambulatory;
use crate::entities::tasks::{Task, TaskQueue, TaskState};
use crate::entities::tasks::{IdleState, Task, TaskQueue, TaskState};
use crate::game::SpawnDelay;
use crate::world::VisibleGameEntity;
use bevy::prelude::*;
@@ -21,6 +22,7 @@ pub struct Dorf {
carry_visual: CarryVisualState,
task_queue: TaskQueue,
task_state: TaskState,
entity_type: EntityType,
}
impl Dorf {
@@ -30,6 +32,7 @@ impl Dorf {
let normal_sprite = asset_server.load("dorf.png");
let carry_sprite = asset_server.load("dorf.png");
let origin = position.as_ivec3();
let behaviour = EntityBehaviourRegistry::global_get("dorf");
Dorf {
ambulatory: Ambulatory {
@@ -54,12 +57,13 @@ impl Dorf {
carry_visual: CarryVisualState::new(normal_sprite, carry_sprite),
task_queue: TaskQueue {
tasks: VecDeque::from([Task::Idle {
target: origin,
wander_radius: 10,
origin,
sigma_world: behaviour.idle.sigma_world,
state: IdleState::Picking,
}]),
},
task_state: TaskState::Pending,
entity_type: EntityType("dorf"),
}
}
}