From e541b77052643201276fc0c4f3857cc9db10fa55 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Sat, 9 Aug 2025 20:41:54 +0800 Subject: [PATCH] =?UTF-8?q?player=20=E5=A6=82=E6=9E=9C=20flip=5Fh,=20?= =?UTF-8?q?=E5=88=99=20offset.x=20=E5=8F=96=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scene/character/main_player.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/character/main_player.gd b/scene/character/main_player.gd index 733ffd24..274a2861 100644 --- a/scene/character/main_player.gd +++ b/scene/character/main_player.gd @@ -261,6 +261,9 @@ func player_action(action_code: int, auto_quit: bool): animation_l = config[3] animation_r = config[4] var playing_animation = _sprite_play_with_auto_flip_h(animation_l, animation_r) + # 如果 flip_h, 则 offset.x 取镜像 + if sprite.flip_h: + sprite.offset.x = -sprite.offset.x # reset animation after one play if sprite.sprite_frames.get_animation_loop(playing_animation): if auto_quit and not sprite.animation_looped.is_connected(_play_animation):