diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-15 00:27:06 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-15 00:27:14 +0200 |
commit | 4924f96bec3f2b0da008ab876fd086bb4a2a9240 (patch) | |
tree | 8b2009fccfe3a560cd6b3e173a19461ed67cc2c3 /pixel-client/src | |
parent | 3b1f4a1cc3b9600ad72164cd08bba1a711b45738 (diff) | |
download | hurrycurry-4924f96bec3f2b0da008ab876fd086bb4a2a9240.tar hurrycurry-4924f96bec3f2b0da008ab876fd086bb4a2a9240.tar.bz2 hurrycurry-4924f96bec3f2b0da008ab876fd086bb4a2a9240.tar.zst |
pc: interact target color
Diffstat (limited to 'pixel-client/src')
-rw-r--r-- | pixel-client/src/game.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pixel-client/src/game.rs b/pixel-client/src/game.rs index 6bb30e68..0a0fc22d 100644 --- a/pixel-client/src/game.rs +++ b/pixel-client/src/game.rs @@ -70,6 +70,7 @@ pub struct Player { _name: String, _character: i32, interact_target_anim: Vec2, + interact_target_anim_pressed: f32, } pub struct Item { @@ -172,6 +173,9 @@ impl Game { player.movement.get_interact_target().as_vec2() + Vec2::new(0., -0.4), dt * 20., ); + player + .interact_target_anim_pressed + .exp_to(if interact { 1. } else { 0. }, dt * 10.); self.camera_center.exp_to(player.movement.position, dt * 5.); } @@ -268,6 +272,7 @@ impl Game { id, Player { interact_target_anim: position, + interact_target_anim_pressed: 0., _character: character, _name: name, message_persist: None, @@ -387,7 +392,11 @@ impl Game { self.misc_textures .interact_target .at(me.interact_target_anim) - .tint(100, 100, 255), + .tint( + 100, + 100 + (me.interact_target_anim_pressed * 150.) as u8, + 100 + ((1. - me.interact_target_anim_pressed) * 150.) as u8, + ), ) } |