diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-21 22:17:49 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-21 22:17:54 +0200 |
commit | 542b0f54760260fad3d27809f3ea81a39608b679 (patch) | |
tree | e590fa22af26915907db18c79877c7d5375efaa2 /pixel-client/src | |
parent | 64e00aad013da92d29851d3e8109a006b4dff8c5 (diff) | |
download | hurrycurry-542b0f54760260fad3d27809f3ea81a39608b679.tar hurrycurry-542b0f54760260fad3d27809f3ea81a39608b679.tar.bz2 hurrycurry-542b0f54760260fad3d27809f3ea81a39608b679.tar.zst |
pc: rename chef/customer textures
Diffstat (limited to 'pixel-client/src')
-rw-r--r-- | pixel-client/src/game.rs | 9 | ||||
-rw-r--r-- | pixel-client/src/render/misc.rs | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/pixel-client/src/game.rs b/pixel-client/src/game.rs index c129f991..f8feb1c8 100644 --- a/pixel-client/src/game.rs +++ b/pixel-client/src/game.rs @@ -360,7 +360,14 @@ impl Game { } for p in self.players.values() { - ctx.draw_world(self.misc_textures.player.at(p.movement.position)); + ctx.draw_world( + if p._character >= 0 { + &self.misc_textures.chef + } else { + &self.misc_textures.customer + } + .at(p.movement.position), + ); if let Some(item) = &p.item { item.draw(ctx, &self.item_sprites, &self.misc_textures) } diff --git a/pixel-client/src/render/misc.rs b/pixel-client/src/render/misc.rs index c1f1295e..05cde8e4 100644 --- a/pixel-client/src/render/misc.rs +++ b/pixel-client/src/render/misc.rs @@ -20,7 +20,8 @@ use hurrycurry_protocol::glam::Vec2; use sdl2::rect::Rect; pub struct MiscTextures { - pub player: Sprite, + pub chef: Sprite, + pub customer: Sprite, pub interact_target: Sprite, pub solid: Rect, } @@ -28,7 +29,8 @@ pub struct MiscTextures { impl MiscTextures { pub fn init(layout: &AtlasLayout) -> Self { MiscTextures { - player: Sprite::new(*layout.get("player+a").unwrap(), Vec2::Y * 0.3, 0.5 + 0.3), + chef: Sprite::new(*layout.get("chef+a").unwrap(), Vec2::Y * 0.3, 0.5 + 0.3), + customer: Sprite::new(*layout.get("customer+a").unwrap(), Vec2::Y * 0.3, 0.5 + 0.3), interact_target: Sprite::new( *layout.get("interact-target-thick+a").unwrap(), Vec2::new(0.5, 1.0), |