haulage system WIP
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
use crate::config::GameConfig;
|
||||
use crate::constants::TILE_SIZE;
|
||||
use crate::constants::*;
|
||||
use crate::entities::cargo::{CarryVisualState, HaulSlot};
|
||||
use crate::entities::shared_components::Ambulatory;
|
||||
use crate::entities::shared_systems::digging::Digger;
|
||||
use crate::game::SpawnDelay;
|
||||
use crate::world::VisibleGameEntity;
|
||||
use bevy::prelude::*;
|
||||
@@ -14,12 +16,18 @@ pub struct Dorf {
|
||||
sprite: Sprite,
|
||||
transform: Transform,
|
||||
visibility: Visibility,
|
||||
digger: Digger,
|
||||
haul_slot: HaulSlot,
|
||||
carry_visual: CarryVisualState,
|
||||
}
|
||||
|
||||
impl Dorf {
|
||||
pub fn new(asset_server: &Res<AssetServer>, position: Vec3) -> Self {
|
||||
let walk_speed = 5.;
|
||||
let run_speed = 6.;
|
||||
let normal_sprite = asset_server.load("dorf.png");
|
||||
let carry_sprite = asset_server.load("dorf.png");
|
||||
|
||||
Dorf {
|
||||
ambulatory: Ambulatory {
|
||||
walk_speed,
|
||||
@@ -34,11 +42,14 @@ impl Dorf {
|
||||
step_history: [0i16; 4],
|
||||
},
|
||||
sprite: Sprite {
|
||||
image: asset_server.load("dorf.png"),
|
||||
image: normal_sprite.clone(),
|
||||
..Default::default()
|
||||
},
|
||||
transform: Transform::from_translation(position).with_scale(Vec3::splat(PIXEL_RATIO)),
|
||||
visibility: Visibility::Hidden,
|
||||
digger: Digger::new(3.0),
|
||||
haul_slot: HaulSlot::default(),
|
||||
carry_visual: CarryVisualState::new(normal_sprite, carry_sprite),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user