From c5c6378303f385c0e06f844943e84d59acaa260d Mon Sep 17 00:00:00 2001 From: 2ndbeam <2ndbeam@disroot.org> Date: Thu, 26 Mar 2026 12:01:58 +0300 Subject: [PATCH] assets: Using new lockpick and stairs sprites - Fixed stairs transparency --- assets/sprites/interactive/stairs.png | Bin 634 -> 744 bytes src/item/lockpick.rs | 2 +- src/layout/stairs.rs | 16 ++++++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/assets/sprites/interactive/stairs.png b/assets/sprites/interactive/stairs.png index d2b0c70259261b4fd1bb091eeb0e0c1d5df3c775..9c8e23a0c8d9c44af6abcf22b59dd672bca05b4d 100644 GIT binary patch delta 707 zcmV;!0zCct1n32jF@K^-L_t(|ob8)2PQySDMJL#oNP~npK_XEkwK)M2B}IzlOf(df zmNV^tZ0{#m^W{`c}li-5!(W` z@YJ?~coTGsPQew>V=#m(_J@M*?;a-hu_DYMgm%T|9KL;gCV%p5501r$h(dt3_mAVJg6Lv<6wvRELIB?iS4~ZAQ=eQSO%ww7u!Xlx zeepX9-~tRav1&foWduMTQx;ec z;LXxRL<(Tn^M~_Yu`Gh+geJM1KSra>0BM0RqY2;3f067%Nm!wBjuA3H-#MQjV8UtFLNZ-S^77bu{|U<&$&jC%4CQ1<53ytj z2|OB$nPj3dEs_XE&~Q!(mH!@(iRc~hFM^RFkUWD>-U8Y;z<(vjLtOw0^iuU2>cNOM p>cNOMxd}>KBzBwoNG2IV@eOJDIn1`E`Gf!f002ovPDHLkV1nD2LAd|` delta 596 zcmV-a0;~P#1^NV#F@H2kL_t(|ob8)Ea)U4sg*SmqxbbQ52{Pj{g%6S{Gr2{Il+5G= z_%t*=M$*7!!61nCSIK_81^e{0l6d2X*O#|1D3rcy$z#+kZ=%dt`0;dxzH8xlI%khl zi~xAHa|>R=wE$8@V_XV=EiR240W@ZN2~z>AipD%zJhboHNq_gYDjqZ);9<6x5EZ~{ z(HIc{G`lzzHUUbQ?ImiC^E4DzG^PgP%a7f>B->-ymcUqeX-k2<3F4wlaE0hLsNst1 ztpfP?%=~qwa}bht#pU@a`?uro^9`axVR3_T`?DeV(~3p2=Ft@ z6#xJ;r!TnLatdMgzdV5^BWhkfHnZKWy>NLf5*JLKF-Sp<;Y zs^+*0MkKeX5wRXXJ4*uqRB&N?oqMD&R5f+>Bh9VhS zC6b|mNQMxR3`H^&$q*Zn42h2ZOClMHWJsS#hBO`$$xtLiX(AblWXKM-WJnV6Xv{Ok zL}OMI5lxIpL)j%v{ypvq_YU|M!N?Yp2ccL3)-OQ+BuB$s08sj diff --git a/src/item/lockpick.rs b/src/item/lockpick.rs index 3eb0087..22cab2c 100644 --- a/src/item/lockpick.rs +++ b/src/item/lockpick.rs @@ -3,7 +3,7 @@ use bevy::prelude::*; use super::*; // TODO: replace with proper sprite -const LOCKPICK_SPRITE: &'static str = "sprites/items/choco_bar.png"; +const LOCKPICK_SPRITE: &'static str = "sprites/items/lockpick.png"; #[derive(Component, Debug, PartialEq, Eq, Default, Clone, Copy, Reflect)] #[reflect(Component, Debug, PartialEq, Default, Clone)] diff --git a/src/layout/stairs.rs b/src/layout/stairs.rs index 104c7fd..a2c47c5 100644 --- a/src/layout/stairs.rs +++ b/src/layout/stairs.rs @@ -5,6 +5,8 @@ use crate::{meters, player::Player}; use super::*; +const STAIRS_SPRITE_PATH: &'static str = "sprites/interactive/stairs.png"; + #[derive(Component, Debug, PartialEq, Eq, Default, Clone, Copy, Reflect)] #[reflect(Component, Debug, PartialEq, Default, Clone)] #[require(InteractiveObject, Collider, Sensor)] @@ -62,11 +64,12 @@ pub fn on_stairs_interact( } pub fn stairs_bundle( - _asset_server: &Res, + asset_server: &Res, position: Vec2, up_position: Option, down_position: Option, ) -> impl Bundle { + let image = asset_server.load(STAIRS_SPRITE_PATH); let (has_up, has_down) = (up_position.is_some(), down_position.is_some()); ( Stairs { @@ -74,7 +77,8 @@ pub fn stairs_bundle( down: down_position, }, Transform::from_xyz(position.x, position.y, -1.), - Children::spawn( + InheritedVisibility::VISIBLE, + Children::spawn(( SpawnWith(move |parent: &mut RelatedSpawner| { if has_up { parent.spawn(( @@ -82,6 +86,10 @@ pub fn stairs_bundle( Collider::cuboid(meters(1.), meters(1.)), Transform::from_xyz(meters(-1.), 0., 0.), )); + parent.spawn(( + Sprite::from_image(image), + Transform::from_xyz(0., meters(1.5), 0.), + )); } if has_down { @@ -91,8 +99,8 @@ pub fn stairs_bundle( Transform::from_xyz(meters(1.), 0., 0.), )); } - }) - ), + }), + )), Name::new(format!("Stairs ({},{})", position.x, position.y)) ) }