Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

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.

(+1)

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

(+1)

I went the lazy route and used a hurt shader that im tweening. I was too lazy to create spritesheets with 6 frames each for 52 cards😂

(+1)

interesting! then I have no idea what you are talking about - I so far worked only on the sprites level :)) maybe will try to get in shaders and stuff later :)

(+1)

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

My tweens look like this for example.

card_texture.material.set("shader_parameter/mix_ratio", 1)
tween_damage.tween_property(card_texture.material, "shader_parameter/current_frame", 6, 0.1)
(+1)

Thank you!