Thank you for the kind words! :D I fought really hard to fix that bug but still haven't figured it out yet. The damage calculations are correct as far as I can tell, but the visual representation of the card value is often off by one after a fight. I'm pretty new to tweens, and my guess is that somewhere in my tweens lies the problem, with some "awaits" in between a destroy tween and the "taking damage" tween, which maybe causes a race condition where the card gets destroyed before the texture is changed.
Tbh I never used tweens, I use animatedsprite2d - you don't have to use animation there, you can just refer to each sprite by number. And e.g. in my current Minesweeper game, I just set the sprite frame number to the logic number and it's quite convenient to organize.
But yep, awaits are hell :D I ended up doing state machine to avoid races and tons of awaits (there are still a lot of them though)
But I'm also new to all this, like 2-3 months in godot/game-dev, so I'm not sure my approaches are good as well, just sharing how I approach these issues
Shaders are pure magic created by math wizards :D
I used this one to make the hit animations with some minor modifications https://godotshaders.com/shader/color-cycling-hit-effect/
This Video explains how to add shaders in godot
card_texture.material.set("shader_parameter/mix_ratio", 1) tween_damage.tween_property(card_texture.material, "shader_parameter/current_frame", 6, 0.1)