Added human texture to house

This commit is contained in:
Glaeder 2024-07-07 18:19:49 +02:00
parent cc39434310
commit f7d21428ff
2 changed files with 12 additions and 2 deletions

View file

@ -1,7 +1,7 @@
use super::{furniture::Furniture, grid::Grid}; use super::{furniture::Furniture, grid::Grid};
use crate::game::{self, ZLayer}; use crate::game::{self, ZLayer};
use comfy::{ 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; use indexmap::IndexSet;
@ -465,9 +465,11 @@ impl Room {
} }
} }
if human_layer {
if let Some(human_pos) = self.human_pos { if let Some(human_pos) = self.human_pos {
//draw_circle(human_pos, 0.5, RED, 20); //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);
}
} }

View file

@ -114,6 +114,14 @@ pub fn setup(state: &mut State, ctx: &mut EngineContext<'_>) {
"/assets/entities/ghost.png" "/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. /// The amount of energy a ghost consumes idle.