attack-human #21

Merged
Glaeder merged 6 commits from attack-human into main 2024-07-07 16:24:01 +00:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit f7d21428ff - Show all commits

View file

@ -1,7 +1,7 @@
use super::{furniture::Furniture, grid::Grid};
use crate::game::{self, ZLayer};
use comfy::{
draw_circle, draw_rect, draw_rect_outline, draw_sprite, error, random_i32, vec2, EngineContext, HashSet, RandomRange as _, Vec2, GOLD, GREEN, PURPLE, RED, WHITE
draw_circle, draw_rect, draw_rect_outline, draw_sprite, error, random_i32, texture_id, vec2, EngineContext, HashSet, RandomRange as _, Vec2, GOLD, GREEN, PURPLE, RED, WHITE
};
use indexmap::IndexSet;
@ -465,10 +465,12 @@ impl Room {
}
}
if human_layer {
if let Some(human_pos) = self.human_pos {
//draw_circle(human_pos, 0.5, RED, 20);
draw_rect(human_pos , vec2(1.0, 2.0) * SCALE, GOLD, ZLayer::Human.into());
draw_sprite(texture_id("human_house"), human_pos, WHITE, ZLayer::Human.into(), vec2(1.0, 2.0) * SCALE);
}
}
/* Debug draw

View file

@ -114,6 +114,14 @@ pub fn setup(state: &mut State, ctx: &mut EngineContext<'_>) {
"/assets/entities/ghost.png"
))
);
ctx.load_texture_from_bytes(
"human_house",
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/assets/entities/human_captured.png"
))
);
}
/// The amount of energy a ghost consumes idle.